Sindbad~EG File Manager
3
�fp � @ s4 d dl Z d dlmZ d dlmZ G dd� de�ZdS )� N)�quote)�Clusterc @ sr e Zd ZdZdZd#ZdgZdZd$d%d&d'd(d)d*gZdZ dZ
eed�dd�Z
eed�dd�Zed�dd�Zd d!� Zd"S )+� saltstackzh
The saltstack cluster profile is intended to be used on saltstack
clusters (Salt Project).
Z Saltstack�salt-masterZ
saltmasterT�compound� �+Filter node list to those matching compound�glob�/Filter node list to those matching glob pattern�grain�-Filter node list to those with matching grain�minion_id_unresolvableF�\Returns the FQDN grain of each minion in the node list when the minion ID is not a hostname.� nodegroup�,Filter node list to those matching nodegroup�pillar�.Filter node list to those with matching pillar�subnet�#Filter node list to those in subnetz#salt-run --out=pprint manage.status)�output�returnc C s: g }t j|jdd��}x|j� D ]\}}|j|� q W |S )N�'�")�json�loads�replace�items�extend)�selfr ZnodesZsalt_json_output�_�value� r! �/usr/lib/python3.6/saltstack.py�_parse_manage_status( s
zsaltstack._parse_manage_status)�
manage_statusr c C sv g }xl|j � D ]`\}}|dkr<| jd|� d�� |j|� qx0|D ](}d|� d�}|j| j|�d j� � qBW qW |S )NZdownzNode(s) z are status down.zsalt --out=newline_values_only z grains.get fqdnr )r Zlog_warnr �append�exec_primary_cmd�strip)r r$ Z hostnames�statusZminionsZminion�node_cmdr! r! r"