Current File : //usr/lib/python3/dist-packages/sos/collector/clusters/__pycache__/saltstack.cpython-312.pyc |
�
-�_gp � �: � d dl Z d dlmZ d dlmZ G d� de� Zy)� N)�quote)�Clusterc �d � e Zd ZdZdZdZdgZdZg d�ZdZ dZ
d ed
efd�Z
ded
efd
�Zd
efd�Zd� Zy)� saltstackzh
The saltstack cluster profile is intended to be used on saltstack
clusters (Salt Project).
� Saltstack)zsalt-master�
saltmasterT))�compound� z+Filter node list to those matching compound)�globr
z/Filter node list to those matching glob pattern)�grainr
z-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.)� nodegroupr
z,Filter node list to those matching nodegroup)�pillarr
z.Filter node list to those with matching pillar)�subnetr
z#Filter node list to those in subnetFz#salt-run --out=pprint manage.status�output�returnc � � g }t j |j dd� � }|j � D ] \ }}|j |� � |S )N�'�")�json�loads�replace�items�extend)�selfr �nodes�salt_json_output�_�values �B/usr/lib/python3/dist-packages/sos/collector/clusters/saltstack.py�_parse_manage_statuszsaltstack._parse_manage_status( sN � ����:�:�f�n�n�S�#�&>�?��(�.�.�0� �H�A�u��L�L��� ��� �
manage_statusc � � g }|j � D ]o \ }}|dk( r'| j d|� d�� |j |� �2|D ]9 }d|� d�}|j | j |� d j � � �; �q |S )N�downzNode(s) z are status down.zsalt --out=newline_values_only z grains.get fqdnr )r �log_warnr �append�exec_primary_cmd�strip)r r# � hostnames�status�minions�minion�node_cmds r �_get_hostnames_from_grainz#saltstack._get_hostnames_from_grain/ s� � �� �,�2�2�4� �O�F�G�����
�
��� �1B�C�D�� � ��)�%� �F�9�&�� B*� +� � �$�$��-�-�h�7��A�G�G�I��� � �r"