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__/saltmaster.cpython-38.pyc

U

-�_g	�@s6ddlZddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPluginc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�
SaltMasterzSalt MasterZ
saltmaster)Zsysmgmt)zsalt-masterzsalt-apic	Cs^|�d�r|�d�n
|�d�|�d�|�d�|��|jdddd	d
ddd
gdd�dS)NZall_logsz
/var/log/saltz/var/log/salt/masterz	/etc/saltz/etc/salt/pki/*/*.pemzsalt-master --versionz#systemctl --full status salt-masterz systemctl --full status salt-apizsalt-key --list allz"salt-run jobs.list_jobs --out=yamlz%salt-run manage.list_state --out=yamlz)salt-run manage.list_not_state --out=yamlz!salt-run manage.joined --out=yaml�)Ztimeout)Z
get_option�
add_copy_specZadd_forbidden_path�add_pillar_rootsZadd_cmd_output)�self�r	�?/usr/lib/python3/dist-packages/sos/report/plugins/saltmaster.py�setups$



�	�zSaltMaster.setupc
Cs�t�d�}d}|�|�r"|�|�g}|D]`}t|ddd��H}zt�|��di��dg�}Wntk
rtg}YnX|�|�W5QRXq*|�	|�dS)	z+ Collect pilliar_roots of all salt configs z/etc/salt/master.d/*confz/etc/salt/master�rzUTF-8)�encodingZpillar_roots�baseN)
�globZpath_exists�append�open�yamlZ	safe_load�get�AttributeError�extendr)rZcfgsZmain_cfgZall_pillar_rootsZcfg�fileZcfg_pillar_rootsr	r	r
r,s"


��
zSaltMaster.add_pillar_rootscCsd}d}|�d||�dS)Nz4(^\s+.*(pass|secret|(?<![A-z])key(?![A-z])).*:\ ).+$z\1******z/etc/salt/*)Zdo_path_regex_sub)rZregexpZsubstr	r	r
�postprocBszSaltMaster.postprocN)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrrrr	r	r	r
rsr)rrZsos.report.pluginsrrrr	r	r	r
�<module>s