| Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
| Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/saltmaster.cpython-38.pyc |
U
-�_g � @ s6 d dl Z d dlZd dlmZmZ G dd� dee�ZdS )� N)�Plugin�IndependentPluginc @ s4 e Zd ZdZdZdZdZdd� Zdd� Zd d
� Z dS )�
SaltMasterzSalt MasterZ
saltmaster)Zsysmgmt)zsalt-masterzsalt-apic C s^ | � d�r| �d� n
| �d� | �d� | �d� | �� | jdddd d
ddd
gdd� d S )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�setup s$
� �zSaltMaster.setupc
C s� t � d�}d}| �|�r"|�|� g }|D ]`}t|ddd��H}zt�|��di ��dg �}W n tk
rt g }Y nX |�|� W 5 Q R X q*| � |� dS ) z+ Collect pilliar_roots of all salt configs z/etc/salt/master.d/*confz/etc/salt/master�rzUTF-8)�encodingZpillar_roots�baseN)
�globZpath_exists�append�open�yamlZ safe_load�get�AttributeError�extendr )r ZcfgsZmain_cfgZall_pillar_rootsZcfg�fileZcfg_pillar_rootsr r r
r , s"