%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__/ovn_central.cpython-312.pyc

�

i��d���|�ddlmZmZmZmZddlZddlZddlZGd�de�ZGd�dee�Z	Gd�deee�Z
y)	�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginNc�8�eZdZdZdZdZdZd�Zgfd�Zd�Z	d�Z
y	)
�
OVNCentralz
OVN Northd�ovn_central)�network�virt)zovn-dbs-bundle.*�ovn_cluster_north_db_serverc��tjj||�}|jr�|j	d|z|j��}|ddk7sd|dvr |jd|jz�|St
j|�}|djd�D]5}|j|�s�tjj||�cS|S)Nzls %s)�	container�statusr�
�outputz?Could not retrieve ovn_controller socket path from container %s)
�os�path�join�_container_name�exec_cmd�
_log_error�re�compile�split�match)�selfr�
regex_name�_sfile�res�pattern�filenames       �@/usr/lib/python3/dist-packages/sos/report/plugins/ovn_central.py�
_find_sockzOVNCentral._find_socks��������d�J�/������-�-��$��$�:N�:N�-�O�C��8�}��!�T��X��%>����(�*.�*>�*>�?���
��*�*�Z�0�� #�H�
� 3� 3�D� 9�<�H��}�}�X�.�!�w�w�|�|�D�(�;�;�<��
�c��|jred|z}|j|dd|j��}|ddk7r|jd|jz�y	tj|d�}n<	t
|j|�d	�5}	tj|�}	ddd�	tjd�D�cgc]}||vr|��
c}S#t
$r|jd|z�YywxYw#t
$r|jd|z�Yddd�ywxYw#1swY��xYw#t$r!}|jd
|�d|���Yd}~yd}~wwxYwcc}w#t$r|jd
|z�YywxYw)Nzcat %sT)�timeout�
foregroundrrrz3Could not retrieve DB schema file from container %srzCannot parse JSON file %s�rzCould not open DB schema file z: �tablesz DB schema %s has no 'tables' key)
rrr�json�loads�	Exception�open�	path_join�load�IOError�dict�keys�AttributeError)	rr!�skip�cmdr�db�f�ex�tables	         r"�get_tables_from_schemaz!OVNCentral.get_tables_from_schema.s�������X�%�C��-�-��T�d�*.�*>�*>� �@�C��8�}��!����!/�15�1E�1E�!F�G��
��Z�Z��H�
�.��

��$�.�.��2�C�8��A��!�Y�Y�q�\���	K�'+�y�y��8��(�4�e�!&�d�!2��4�
4��#�
���� ;�h� F�G��
��%�����7�(�B�D��
��������
����>F��K�M���
��
4���	K��O�O�>��I�J�	K�s��C�3D3�D'�C<�&D3�/E%�	
E �E%�C9�8C9�<D$�D'�D3�#D$�$D'�'D0�,D3�3	E�<E�E� E%�%F�Fc�D�|sy|D]}|j|�d|����y)Nz list )�append)rr)�cmds�ovn_cmdr9s     r"�add_database_outputzOVNCentral.add_database_outputOs(�����	9�E��K�K���7�8�	9r$c	��|j|jd�r$|j|jd�|_n#|j|jd�|_tj
j
d�}dD]j}|j|jd|�|jd|�|jd|�g�|s�J|j|j||���l|jd�r|jd	�n|jd
�|j|j|j�}|j|j|j�}|jdj|j �dj|j"�d
j|�dj|�dj|�gd|jd��gd�}gd�}dD]6}|j%|j|d��}|j'||d��8|}	dD]8}|j%|j|d�dg�}
|j'|
|d��:|	|z
}	t)t+|	��}	|j|	d|j��|jd�tj
j
d�}dD]�}dD][}|j||�}
tj,j/|
�s�5|j|
�|jd |
zd�!��]|s�f|j|j||����|j1d"�#�y)$N�r�
OVS_RUNDIR)zovnnb_db.pidzovnsb_db.pidzovn-northd.pid�/var/lib/openvswitch/ovnz/usr/local/var/run/openvswitchz/run/openvswitch/�all_logsz
/var/log/ovn/z/var/log/ovn/*.logz.ovs-appctl -t {} cluster/status OVN_Northboundz.ovs-appctl -t {} cluster/status OVN_Southboundzovn-appctl -t {} statusz,ovn-appctl -t {} debug/chassis-features-listz"ovn-appctl -t {} connection-statusT�)r'rr&)zovn-nbctl --no-leader-only showz"ovn-nbctl --no-leader-only get-sslz)ovn-nbctl --no-leader-only get-connection)zovn-sbctl --no-leader-only showz%ovn-sbctl --no-leader-only lflow-listz"ovn-sbctl --no-leader-only get-sslz)ovn-sbctl --no-leader-only get-connection)z/usr/share/openvswitchz/usr/share/ovnzovn-nb.ovsschemazovn-nbctl --no-leader-onlyzovn-sb.ovsschema�Logical_Flowzovn-sbctl --no-leader-only)r'rz/etc/sysconfig/ovn-northd�	OVS_DBDIR)zovnnb_db.dbzovnsb_db.db)rCz/usr/local/etc/openvswitchz/etc/openvswitchz/var/lib/openvswitchz/var/lib/ovn/etcz/var/lib/ovnz
ls -lan %s)r'z
ovn-northd)�units)�container_exists�
containers�get_container_by_namerr�environ�get�
add_copy_specr.�
get_optionr#�
ovn_sock_path�ovn_controller_sock_regex�ovn_northd_sock_regex�add_cmd_output�format�ovn_nbdb_sock_path�ovn_sbdb_sock_pathr:r?�list�setr�exists�add_journal)r�
ovs_rundir�pidfile�ovn_controller_sock_path�northd_sock_path�
nbctl_cmds�
sbctl_cmdsr�	nb_tablesr=�	sb_tables�	ovs_dbdir�dbfile�
dbfilepaths              r"�setupzOVNCentral.setupUs���� � �����!3�4�#'�#=�#=�����"�$$�D� �$(�#=�#=�����"�$$�D� ��Z�Z�^�^�L�1�
�I�	H�G�������9�7�C����?��I����2�G�<� �
���"�"�4�>�>�*�g�#F�G�	H��?�?�:�&�����/����3�4�#'�?�?����� >� >�$@� � �?�?�4�+=�+=�+/�+E�+E�G��	
���@�G�G��+�+�-�@�G�G��+�+�-�)�0�0�1A�B�>�E�E�$�&�4�;�;�,�.�

��t�';�';�R�	�
	
� 
�
�
�
�A�	C�D��3�3�D�N�N��(�5*�+�I��$�$�Y�
�%A�
C�	C���@�	C�D��3�3�D�N�N��(�5*�,:�+;�=�I��$�$�Y�
�%A�
C�	C�
	
�
���
�C��I�������T�T�-A�-A�	�	
�	
���6�7��J�J�N�N�;�/�	�4�	F�F��
D��"�^�^�D�&�9�
��7�7�>�>�*�-��&�&�z�2��'�'�$�z�1�d�(�D�
D���"�"�4�>�>�)�V�#D�E�	F�"	
���|��,r$N)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesrJr#r:r?rf�r$r"rrs2���J��K�"�H�D�J��"57�K�B9�i-r$rc�$�eZdZdZdZdZdZdZdZy)�RedHatOVNCentral)zopenvswitch-ovn-centralz
ovn.*-centralz!/var/run/openvswitch/ovnnb_db.ctlz!/var/run/openvswitch/ovnsb_db.ctlz/var/run/openvswitch�ovn-controller.*.ctl�ovn-northd.*.ctlN�	rgrhri�packagesrUrVrPrQrRrmr$r"roro�s$��=�H�<��<��*�M� 6��.�r$roc�$�eZdZdZdZdZdZdZdZy)�DebianOVNCentral)zovn-centralz/var/run/ovn/ovnnb_db.ctlz/var/run/ovn/ovnsb_db.ctlz/var/run/ovnrprqNrrrmr$r"ruru�s$�� �H�4��4��"�M� 6��.�r$ru)�sos.report.pluginsrrrrr*rrrrorurmr$r"�<module>rwsG�����	�	�h-��h-�V/�z�<�/�/�z�<��/r$

Zerion Mini Shell 1.0