Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/gluster.cpython-38.pyc

U

-�_g��@sBddlZddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�RedHatPlugin�	PluginOptc@sLeZdZdZdZdZdZdZdZe	ddd	d
�gZ
dd�Zd
d�Zdd�Z
dS)�GlusterzGlusterFS storageZgluster)ZstorageZvirtz/run/gluster)Z	glusterfszglusterfs-core)z
/etc/glusterdz/var/lib/glusterd�dumpFzenable glusterdump support)�defaultZdescc	
s|d}�fdd���|�D�}|D]V}|d}��||�}d}|dkr t|ddd��}|��d}|�d	�}W5QRXq<q d
S)z Wait until state dump is done rcsg|]}��|�r|�qS�)Zpath_isfile)�.0�f��selfr�</usr/lib/python3/dist-packages/sos/report/plugins/gluster.py�
<listcomp>!s
z.Gluster.wait_for_statedump.<locals>.<listcomp>�����rzUTF-8)�encodingZ
DUMP_END_TIMEN)�listdirZ	path_join�open�	readlines�count)	rZname_dirZstatedumps_presentZstatedump_entriesZstatedump_fileZ_spathZretZsfile�	last_linerrr
�wait_for_statedumps
�zGluster.wait_for_statedumpc
Cs�|�d�r�|�|j�sdSz>t�|jd�}|�t�|jd��|D]}t�|�qFWn2tk
r�}z|�d|���W5d}~XYnXdS)Nrz/*.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�OSErrorZ
_log_error)rZremove_files�name�errrrr
�postproc-s
�zGluster.postproccCs�|�d�|�d�|jddd�|�d�|jddd�|�d	d
ddd
ddgt�d��|�d�sx|�dddg�n
|�d�|�d��r$|�|j�r�d}|�|�ddkr�t�	d�|�
|j�|�|j�q�|j�d�n|j�
d|j�|�d�}|ddk�r$|d��d}|�|�|jd d!d�}|ddk�r�|d��D]�}|�d"��s`�qL|d#d�}|�d$|�d%�d&|�d'�d(|�d)�d(|�d*�d+|�d,�d-|��d.|�d/�d0|�d'�d1|��d2|��g
��qLdS)3Nz,/var/lib/glusterd/geo-replication/secret.pemz6/var/lib/glusterd/glusterfind/glusterfind_*_secret.pemzgluster peer statusZgluster_peer_status)Ztagszgluster pool listzgluster volume statusZgluster_v_statusz/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/*Zall_logsz/var/log/glusterfs/*logz/var/log/glusterfs/*/*logz)/var/log/glusterfs/geo-replication/*/*logz/var/log/glusterfsrz+killall -USR1 glusterfs glusterfsd glusterdZstatusrrz6could not send SIGUSR1 to glusterfs/glusterd processesz4Unable to generate statedumps, no such directory: %szgluster get-state�outputrzgluster volume infoZgluster_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 )Zadd_forbidden_pathZadd_cmd_outputZ
add_copy_specrrrrZexec_cmd�time�sleeprZsoslog�infoZwarning�splitZcollect_cmd_output�
splitlines�
startswith)rZ
statedump_cmd�stateZ
state_fileZ
volume_cmd�lineZvolnamerrr
�setup:s|
�
��
�
�

�

�






�z
Gluster.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesrZpackages�filesrZoption_listrr#r.rrrr
rs�
r)rrr&Zsos.report.pluginsrrrrrrrr
�<module>	s