File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/__pycache__/manage.cpython-310.pyc
o
�N�g�g � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZ ddl
Z
ddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZ e�d�Ze�e�Zdd� Z d:d
d�Zdd
� Z d;dd�Z! d<dd�Z"d=dd�Z#d=dd�Z$d=dd�Z%d=dd�Z&d=dd�Z'd=dd�Z(d=dd �Z)d=d!d"�Z*d=d#d$�Z+d=d%d&�Z,d=d'd(�Z-d=d)d*�Z.d>d+d,�Z/d-d.� Z0 / 0 1 1 2 3 4d?d5d6�Z1 1 7 d@d8d9�Z2dS )Azd
General management functions for salt, tools like seeing what hosts are up
and what hosts are down
� N)�SaltClientError�SaltSystemExitz!^([a-f0-9]{2}:){15}([a-f0-9]{2})$c C s� t j�td ��m}|j| dd|d|ddd�}|s!|W d � S t�dd�t|d ��� t � }|j
|d
|d |�|�| ||d�D ]}|r[|�� D ]\}} t�d|� |�
|� qKqCtt |d �| �}
t|�}||
fW d � S 1 sxw Y d S )
N� conf_filez test.ping� � T)�listenz3manage runner will ping the following minion(s): %sz, �minionsZjid)�gather_job_timeoutzminion '%s' returned from ping)�salt�client�get_local_client�__opts__Zrun_job�log�debug�join�sorted�setZget_cli_event_returnsZ_get_timeout�items�add)�tgt�tgt_type�timeoutr r Zpub_dataZreturnedZfn_retZmid�_Znot_returnedr r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/manage.py�_ping! s: ���
� �$�r T�*�globc C sJ i }|st d }|st d }t||||�}|sg g fn|\|d<