403Webshell
Server IP : 138.197.176.125  /  Your IP : 216.73.217.54
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.3.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/collector/clusters/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/sos/collector/clusters/__pycache__/saltstack.cpython-38.pyc
U

-�_gp�@s4ddlZddlmZddlmZGdd�de�ZdS)�N)�quote)�Clusterc@sreZdZdZdZdZdgZdZdddd	d
ddgZd
Z	dZ
eed�dd�Z
eed�dd�Zed�dd�Zdd�ZdS)�	saltstackzh
    The saltstack cluster profile is intended to be used on saltstack
    clusters (Salt Project).
    Z	Saltstack)zsalt-masterZ
saltmasterT)Zcompound�z+Filter node list to those matching compound)�globrz/Filter node list to those matching glob pattern)Zgrainrz-Filter node list to those with matching grain)�minion_id_unresolvableFz\Returns the FQDN grain of each minion in the node list when the minion ID is not a hostname.)Z	nodegrouprz,Filter node list to those matching nodegroup)Zpillarrz.Filter node list to those with matching pillar)Zsubnetrz#Filter node list to those in subnetFz#salt-run --out=pprint manage.status)�output�returncCs6g}t�|�dd��}|��D]\}}|�|�q|S)N�'�")�json�loads�replace�items�extend)�selfrZnodesZsalt_json_output�_�value�r�B/usr/lib/python3/dist-packages/sos/collector/clusters/saltstack.py�_parse_manage_status(s
zsaltstack._parse_manage_status)�
manage_statusr	cCsng}|��D]\\}}|dkr:|�d|�d��|�|�q|D](}d|�d�}|�|�|�d���q>q|S)NZdownzNode(s) z are status down.zsalt --out=newline_values_only z grains.get fqdnr)rZlog_warnr�append�exec_primary_cmd�strip)rrZ	hostnames�statusZminionsZminion�node_cmdrrr�_get_hostnames_from_grain/s
��z#saltstack._get_hostnames_from_grain)r	cCsX|�|j�}|ddkr td��|�d�rJt�|d�dd��}|�|�S|�|d�S)Nrrz-Node enumeration did not return usable outputrrr
r)	rr�	Exception�
get_optionrr
rrr)r�resrrrr�
_get_nodes@s

zsaltstack._get_nodescCsX|jD]H}|ddkr|�|d�}|r|jdt|��d|d��7_qPq|��S)Nrrz tgt=z
 tgt_type=)�option_listrrrr!)rZoptionZoptrrr�	get_nodesIs
"zsaltstack.get_nodesN)�__name__�
__module__�__qualname__�__doc__Zcluster_nameZpackagesZsos_pluginsZstrict_node_listr"Ztargetedr�str�listr�dictrr!r#rrrrrs&�
	r)rZshlexrZsos.collector.clustersrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit