File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/supervisord.cpython-310.pyc
Back
o ;j], � @ s� d Z ddlZddlZddlZddlmZmZ dd� Zdd� Z dd � Z d d� Zd'd d�Zd'dd�Z d'dd�Zd(dd�Zd(dd�Zd(dd�Zd)dd�Zd)dd�Zd)dd�Zd(dd �Zd*d!d"�Zd*d#d$�Zd)d%d&�ZdS )+zR Provide the service module for system supervisord or supervisord in a virtualenv � N)�CommandExecutionError�CommandNotFoundErrorc C s dS )NT� r r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/supervisord.py�__virtual__ s r c C sr d}| st d |g�}|du rtd|� d���|S tj�| �r7tj�| d|�}tj�|�r/|S td|� d���| S )z� Return supervisorctl command to call, either from a virtualenv, an argument passed in, or from the global modules options Z supervisorctlz cmd.which_binNzCould not find a `z` binary�bin)�__salt__r �os�path�isdir�join�isfile)�bin_env�cmdZwhich_resultZcmd_binr r r �_get_supervisorctl_bin s r c C s: t |�g}|dur|d|g7 }|�| � |r|�|� |S )z( Return the command list to use Nz-c)r �append)r �name� conf_filer �retr r r �_ctl_cmd* s r c C s* | d }| d dkrd|vrd|� �}|S )N�stdout�retcoder �ERRORzERROR: r )r Zretmsgr r r �_get_return7 s r �allc C �: | � d�r| dd� } td td| ||�|dd�}t|�S )a� Start the named service. Process group names should not include a trailing asterisk. user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.start <service> salt '*' supervisord.start <group>: �:*N����cmd.run_all�startF�ZrunasZpython_shell��endswithr r r �r �userr r r r r r r @ � �r c C r )a� Restart the named service. Process group names should not include a trailing asterisk. user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.restart <service> salt '*' supervisord.restart <group>: r Nr r �restartFr r! r# r r r r&