%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/supervisord.pyc

�
���^c@@s�dZddlmZmZmZddlZddlmZeje	�Z
d�Zd�Ze
e
dddd�Zdddd�Zee
dddd	�ZdS(
u
Interaction with the Supervisor daemon
======================================

.. code-block:: yaml

    wsgi_server:
      supervisord.running:
        - require:
          - pkg: supervisor
        - watch:
          - file: /etc/nginx/sites-enabled/wsgi_server.conf
i(tabsolute_importtunicode_literalstprint_functionN(tsixc@sii}d�kr[t�fd�dddgD��rD||d<qe�|d<t|d<n
||d<|S(NuERRORc3@s|]}|�kVqdS(N((t.0t	substring(tresult(s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pys	<genexpr>sualready startedunot runninguprocess group already activeucommenturesult(tanytFalse(Rtsuccess_messagetret((Rs;/usr/lib/python2.7/site-packages/salt/states/supervisord.pyt_check_errors



cC@s$|dkrtS|d	kr tStS(
NuSTOPPEDuSTOPPINGuEXITEDuFATALuBACKOFFuSTARTINGuRUNNING(uSTOPPEDuSTOPPINGuEXITEDuFATALuBACKOFF(uSTARTINGuRUNNING(tTrueR(tstate((s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pyt_is_stopped_state,s
c@sZ�jd�r�d �ni�d6td6dd6id6}dtkrbt|d<d	|d<|Stdd
|d|d|�}t�}	x;|D]3}
d
|
kr�|	j|
|
jd
�d �q�q�Wt|	�}	i}�|kr|�dj�dk|�<nN�|	krUx?�fd�|D�D]$}||dj�dk||<q*Wnt	|�}
t
dr�|
scgtj|�D]\}}|tkr�|^q�}|r(d+|d<�jd
�rt|�t|�kr�dj��|d<q%djdj|��|d<q`dj��|d<q��jd
�rMdj��|d<q�dj��|d<nMd+|d<�jd
�r�dj��}ndj��}dj|�|d<|Sg}t}|r/d}tdd
|d|d|�}|jt||��tj|�dj��|kr�t}q�n�|
r�dj��}td d
|d|d|�td!�d
|d|d|�}|jt||��|j|�tj|�nd+}d+}�|	krd"}t}xv|D]3}
|
j��r�t||
d�r�t}Pq�q�Wn8�|krSd#}t|�d�rJt}qSt}n|tkr�|r�|r�d$j|d+k	r�d%j|�p�d��}tj|�td&�d
|d|d|�}|jt||��|j|�q&|r>d'j|d+k	rd%j|�pd��}|}|ji|d6�q&d(j|d+k	r_d%j|�pbd��}|}|ji|d6�n�|s&d)j|d+k	r�d%j|�p�d��}|j|�tj|�td*�d
|d|d|�}|jt||��tjtj|��n|drVt|�rVdj|�|d�<n|S(,u�
    Ensure the named service is running.

    name
        Service name as defined in the supervisor configuration file

    restart
        Whether to force a restart

    update
        Whether to update the supervisor configuration.

    user
        Name of the user to run the supervisorctl command

        .. versionadded:: 0.17.0

    conf_file
        path to supervisorctl config file

    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    u:*i����unameuresultuucommentuchangesusupervisord.statusuESupervisord module not activated. Do you need to install supervisord?tusert	conf_filetbin_envu:iustateurunningc3@s$|]}|j��r|VqdS(N(t
startswith(Rtx(tname(s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pys	<genexpr>osutestu+All services in group '{0}' will be startedu+The following services will be started: {0}u uService {0} will be startedu/All services in group '{0}' are already runninguService {0} is already runninguGroup '{0}'uService {0}u{0} will be added and starteduUpdating supervisorusupervisord.updateu{0}: updateduAdding service: {0}usupervisord.rereadusupervisord.addugroupuserviceuRestarting{0}: {1}u {0}usupervisord.restartuNot starting updated{0}: {1}u$Not starting already running{0}: {1}uStarting{0}: {1}usupervisord.startN(tendswithRt__salt__Rtsettaddtindextsortedtlowertboolt__opts__Rt	iteritemstNonetlentformattjointupdateRtlogtdebugtappendRRt	text_type(RtrestartR#RRRtkwargsR
t
all_processestprocess_groupstproctmatchestprocesstto_addRtytto_startt_typetchangestjust_updatedtcommentRt
is_stoppedtprocess_type((Rs;/usr/lib/python2.7/site-packages/salt/states/supervisord.pytrunning4s� 
"


		
%!%

4


	

	

		
	
				

	c	K@si|d6td6dd6id6}tdrLd|d<dj|�|d<n�dj|�}tj|�td	d
|d|d|�}g}x;|D]3}	d
|	kr�|j|	|	jd
�d �q�q�Wt	t
|��}d}
||kr6t}
x�|D]3}	|	j|�r�t
||	d�r�t}
Pq�q�WnI||krht
||d�r_t}
qt}
ndj|�|d<|S|
tkr�dj|�|d<ncitd|d
|d|d|�|6}|jt||��||d|<tjtj|��|S(u�
    Ensure the named service is dead (not running).

    name
        Service name as defined in the supervisor configuration file

    user
        Name of the user to run the supervisorctl command

        .. versionadded:: 0.17.0

    conf_file
        path to supervisorctl config file

    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    unameuresultuucommentuchangesutestu Service {0} is set to be stoppeduStopping service: {0}usupervisord.statusRRRu:iustateuService {0} doesn't existuService {0} is not runningusupervisord.stopN(RRRR!R$R%RR&RtlistRRRRR#RRR'(RRRRR)R
R5R*R+R,R6R((s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pytdeadsP"



	
%
		

cK@s(t|d|d|d|d|d|�S(uS
    The supervisord watcher, called to invoke the watch command.
    Always restart on watch

    .. note::
        This state exists to support special handling of the ``watch``
        :ref:`requisite <requisites>`. It should not be called directly.

        Parameters for this function should be set by the state being triggered.
    R(R#RRR(R8(RR(R#RRRR)((s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pyt	mod_watchfs(t__doc__t
__future__RRRtloggingtsalt.extRt	getLoggert__name__R$RRRRR8R:RR;(((s;/usr/lib/python2.7/site-packages/salt/states/supervisord.pyt<module>s&			�Q

Zerion Mini Shell 1.0