Your IP : 216.73.217.13


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

U

���b
�@s&ddlmZmZGdd�dee�ZdS)�)�Plugin�RedHatPluginc@s4eZdZdZdZdZdZdZdZdd�Z	dd�Z
d	S)
�etcdzetcd plugin)r)Z	container�system�servicesZcluster)�/etc/origin/node/pods/etcd.yamlcs�|�d�rd�nd�|�ddi�|���|�ddg�|�d�d	d
ddg}|��fd
d�|D��dddg}�r�|��fdd�|D��|�d�dS)Nrzmaster-exec etcd etcd etcdctlZetcdctl�/etc/etcd/etcd.confZ	etcd_confz/etc/etcd/caz/etc/etcd/*.keyz	/etc/etcdz	--versionzmember listzcluster-healthzls --recursivecsg|]}d�|f�qS)z%s %s�)�.0�sub)�etcd_cmdr	�9/usr/lib/python3/dist-packages/sos/report/plugins/etcd.py�
<listcomp>2szetcd.setup.<locals>.<listcomp>z/v2/stats/leaderz/v2/stats/selfz/v2/stats/storecsg|]}d�|f�qS)zcurl -s %s%sr	)r
�u)�etcd_urlr	r
r;szls -lR /var/lib/etcd/)Zpath_existsZ
add_file_tags�get_etcd_urlZadd_forbidden_pathZ
add_copy_specZadd_cmd_output)�selfZsubcmdsZurlsr	)rrr
�setups4
��
��z
etcd.setupcCs�z`t|�d�d��F}|D]:}|�d�r|�d�d�dd���W5QR�WSqW5QRXWn\tk
r�d}z*|jjj	d	}|d
d}|dkr�d
}Wnt
k
r�YnX|YSXdS)Nr�rZETCD_LISTEN_CLIENT_URLS�=��"�zhttp://localhost:2379r�versionr�2zhttp://localhost:4001)�openZ	path_join�
startswith�split�replace�strip�IOErrorZpolicyZpackage_manager�packages�	Exception)rZef�lineZurlZverr	r	r
r?s
<zetcd.get_etcd_urlN)�__name__�
__module__�__qualname__Z
short_descZplugin_namer!Zprofiles�filesrrrr	r	r	r
rs&rN)Zsos.report.pluginsrrrr	r	r	r
�<module>s