%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/openstack_database.cpython-312.pyc

�

i��d�	��N�ddlZddlmZmZmZGd�de�ZGd�dee�Zy)�N)�Plugin�RedHatPlugin�	PluginOptc�Z�eZdZdZdZdZeddd��eddd	��gZgd
�Zd�Z	dd
�Z
y)�OpenStackDatabasezOpenstack Database Information�openstack_database)�	openstack�openstack_controller�dumpFzDump select databases)�default�desc�dumpallzDump ALL databases)�cinder�glance�heat�ironic�keystone�mistralz(.*)?neutronznova.*c�"�ddg}d}|D]}|j|�}|s�n|rd|znd}|jd|d|��|jd�s|jd�r-|j|�	�}d
|z}|j|dd|�
�yy)Nzgalera-bundle-.*�mysqlzclustercheck_%s�clustercheck�)�	container�timeout�suggest_filenamerr�rzmysqldump --opt %szmysql_dump.sqlr)r�	sizelimitr)�get_container_by_name�add_cmd_output�
get_option�get_mysql_db_string)�self�_db_containers�cnamer�fname�db_dump�db_cmds       �G/usr/lib/python3/dist-packages/sos/report/plugins/openstack_database.py�setupzOpenStackDatabase.setup's���
��
��
��'�	�I��.�.�y�9�E���	�
.3�!�E�)������N�e�R�-2�	�	4��?�?�6�"�d�o�o�i�&@��.�.��.�?�G�)�G�3�F�����9I�*+�u�
 �
>�	'A�Nc
�R�|jd�ryg}|jd|��}|dj�D]K}t|jD�cgc]}tj||���c}�s�;|j|��Mddjd�|D��zScc}w)	Nrz--all-databaseszmysql -e "show databases;"r�outputz-B � c3� K�|]}|���y�w�N�)�.0�ds  r(�	<genexpr>z8OpenStackDatabase.get_mysql_db_string.<locals>.<genexpr>Ks����3�a��3�s�)	r �exec_cmd�
splitlines�any�	databases�re�match�append�join)r"r�collect�dbs�db�regs      r(r!z%OpenStackDatabase.get_mysql_db_string?s����?�?�9�%�$����m�m�8�I�m�N���h�-�*�*�,�	#�B�����@�#�B�H�H�R��%�@�A����r�"�	#��s�x�x�3�7�3�3�3�3��As�B$
r/)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr�option_listr7r)r!r0r*r(rrsE��1�J�&�K�4�H�	�&�%�.E�F��)�U�1E�F��K�
	�I�>�04r*rc��eZdZdZy)�RedHatOpenStackDatabase)zopenstack-selinuxN)r@rArB�packagesr0r*r(rHrHNs��&�Hr*rH)r8�sos.report.pluginsrrrrrHr0r*r(�<module>rKs.��
�?�>�:4��:4�z'�/��'r*

Zerion Mini Shell 1.0