File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/engines/__pycache__/__init__.cpython-310.pyc
o
�N�g�
� @ sZ d Z ddlZddlZddlZddlZddlZe�e�Zddd�Z G dd� dej
jj�Z
dS )z�
Initialize the engines system. This plugin system allows for
complex services to be encapsulated within the salt plugin environment
� Nc C sd t jj| |d�}| d dkrt jj| |d�}ng }t jj| ||d�}t jj| ||||d�}| �dg �}t|t�rAdd� |� � D �}t jj
�� rMd }d }d }|D ]`}t|t�ratt
|� � ��\}} nd } d }
| d urzd
| v rzd�| d
�}|}
| d
= n|� d�}||v r�|| }|
r�d
|j� d|
� d�}
nd
|j� d�}
t�d|
� |jt| || |||f|
d� qOd S )z)
Fire up the configured engines!
��proxy�__role�master��utils�r r �enginesc S s g | ]\}}||i�qS � r
)�.0�k�vr
r
�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/engines/__init__.py�
<listcomp> s z!start_engines.<locals>.<listcomp>NZ
engine_modulez{}.startz.startzEngine(z, name=�)zStarting %s)�args�name)�salt�loaderr �runner�minion_modsr �get�
isinstance�dict�items�platform�spawning_platform�next�iter�format�
__module__�log�infoZadd_process�Engine)�optsZproc_mgrr r �runners�funcsr Zengines_opt�engineZengine_optsZengine_name�funZ
start_funcr r
r
r �
start_engines sH
���r) c s( e Zd ZdZ� fdd�Zdd� Z� ZS )r# z3
Execute the given engine in a new process
c s: t � jdi |�� || _|| _|| _|| _|| _|| _dS )z-
Set up the process executor
Nr
)�super�__init__r$ �configr( r&