Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/gluster.cpython-312.pyc
�

-�_g���H�ddlZddlZddlZddlmZmZmZGd�dee�Zy)�N)�Plugin�RedHatPlugin�	PluginOptc�N�eZdZdZdZdZdZdZdZe	ddd	�
�gZ
d�Zd�Zd
�Z
y)�GlusterzGlusterFS storage�gluster)�storage�virtz/run/gluster)�	glusterfszglusterfs-core)z
/etc/glusterdz/var/lib/glusterd�dumpFzenable glusterdump support)�default�descc�X�d}|j|�D�cgc]}|j|�s�|��}}|D]b}|dz}|j||�}d}|dk(s�"t|dd��5}|j	�d}	|	jd�}ddd�|dk(r�A�dycc}w#1swY�xYw)	z Wait until state dump is done r�����rzUTF-8)�encoding�
DUMP_END_TIMEN)�listdir�path_isfile�	path_join�open�	readlines�count)
�self�name_dir�statedumps_present�f�statedump_entries�statedump_file�_spath�ret�sfile�	last_lines
          �</usr/lib/python3/dist-packages/sos/report/plugins/gluster.py�wait_for_statedumpzGluster.wait_for_statedumps������<�<��1�
��T�5E�5E�a�5H��
��
�0�	;�N�!3�A�!5���^�^�H�n�=�F��C���)��&�#��8�;�E� %��� 1�"� 5�I�#�/�/�/�:�C�;���)�		;��
�;�;�s�B�B�%%B � B)	c��|jd�r�|j|j�sy	tj|jdz�}|j	tj|jdz��|D]}tj|��yy#t$r}|jd|���Yd}~yd}~wwxYw)Nrz/*.dump.[0-9]*z/glusterd_state_[0-9]*_[0-9]*z"Could not remove statedump files: )	�
get_option�path_exists�
statedump_dir�glob�extend�os�remove�OSError�
_log_error)r�remove_files�name�errs    r%�postproczGluster.postproc-s����?�?�6�"��#�#�D�$6�$6�7��
L�#�y�y��);�);�>N�)N�O���#�#�D�I�I�d�.@�.@�$C�/D�%E�F�(�$�D��I�I�d�O�$�#���
L����"D�S�E� J�K�K��
L�s�A/B � 	C�)C�Cc��|jd�|jd�|jdd��|jd�|jdd��|jgd	�tjd
�z�|j	d�s|jgd��n|jd
�|j	d��r|j|j�r�d}|j|�ddk(rLtjd�|j|j�|j|j�nB|jjd�n&|jjd|j�|jd�}|ddk(r'|dj�d}|j|�|jdd��}|ddk(rp|dj!�D]Y}|j#d�s�|dd}|jd|�d�d|�d�d |�d!�d |�d"�d#|�d$�d%|��d&|�d'�d(|�d�d)|��d*|��g
��[yy)+Nz,/var/lib/glusterd/geo-replication/secret.pemz6/var/lib/glusterd/glusterfind/glusterfind_*_secret.pemzgluster peer status�gluster_peer_status)�tagszgluster pool listzgluster volume status�gluster_v_status)z/etc/redhat-storage-releasez/etc/swift/z/etc/glusterd.rpmsavez/etc/glusterfsz/var/lib/glusterd/z(/run/gluster/shared_storage/nfs-ganesha/z$/var/lib/glusterd/glusterfind/.keys/z/run/gluster/*tier-dht/*�all_logs)z/var/log/glusterfs/*logz/var/log/glusterfs/*/*logz)/var/log/glusterfs/geo-replication/*/*logz/var/log/glusterfsrz+killall -USR1 glusterfs glusterfsd glusterd�statusrrz6could not send SIGUSR1 to glusterfs/glusterd processesz4Unable to generate statedumps, no such directory: %szgluster get-state�outputrzgluster volume info�gluster_v_infozVolume Name:�zgluster volume get z allzgluster volume geo-replication z statuszgluster volume heal z infoz info split-brainzgluster volume status z clientszgluster snapshot list zgluster volume quota z listzgluster volume rebalance zgluster snapshot info zgluster snapshot status )�add_forbidden_path�add_cmd_output�
add_copy_specr+r(r)r*�exec_cmd�time�sleepr&�soslog�info�warning�split�collect_cmd_output�
splitlines�
startswith)r�
statedump_cmd�state�
state_file�
volume_cmd�line�volnames       r%�setupz
Gluster.setup:s������ N�O����D�	
�	
���1�8M��N����/�0����3�!3�	�	5�	
���

�
�I�I�0�1�
2�
	3����z�*���� �
�
���3�4��?�?�6�"����� 2� 2�3� M�
��=�=��/��9�Q�>��J�J�q�M��+�+�D�,>�,>�?��&�&�t�'9�'9�:��K�K�$�$�&:�;����#�#�%4�59�5G�5G�I��M�M�"5�6�E��X��!�#�"�8�_�2�2�4�R�8�
��"�"�:�.��,�,�-B�2B�-�D�
��h��1�$�"�8�,�7�7�9�
�����~�6���r�s�)���#�#�)�'��$�7�5�g�Y�g�F�*�7�)�5�9�*�7�)�3D�E�,�W�I�X�>�,�W�I�6�+�G�9�E�:�/��y��@�,�W�I�6�.�w�i�8�%��	
�%�N)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr*�packages�filesr�option_listr&r4rQ�rRr%rrsG��$�J��K�"�H�"�M�.�H�2�E�	�&�%�.J�K��K�
;�L�IrRr)r+r-rB�sos.report.pluginsrrrrr\rRr%�<module>r^s&���	��>�>�t�f�l�trR