File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/saltmaster.cpython-39.opt-1.pyc
a
\��h�
� @ 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 sX g | _ | �d�r| �d� n
| �d� | �d� | �d� | �� | jg d�dd� d S ) NZall_logsz
/var/log/saltz/var/log/salt/masterz /etc/saltz/etc/salt/pki/*/*.pem)zsalt-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� )�timeout)�collected_pillar_rootsZ
get_option�
add_copy_specZadd_forbidden_path�add_pillar_rootsZadd_cmd_output)�self� r �A/usr/lib/python3.9/site-packages/sos/report/plugins/saltmaster.py�setup s
�zSaltMaster.setupc
C s� t � d�}d}| �|�r"|�|� g }|D ]r}t|ddd��P}zt�|��di ��dg �}W n tyr g }Y n0 |�|� W d � q*1 s�0 Y 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 )r
ZcfgsZmain_cfgZall_pillar_rootsZcfg�fileZcfg_pillar_rootsr r r r . s"