%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	ddl
Z	ddlmZddl
mZidd6Zd�Zd	�Zd
�Zdd�Zd
�ZdS(u-
Module to provide information about minions
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(trangeulistulist_cC@s-tddd�}tddd�}|jdd�}|d
krSt|�}nt|�}i}x�|D]�}g|tjj|�<y�xytjj	j
tj|��D]Y}|jd	�s�tjj
tjj||��r|tjj|�j|�qq�q�WWqlttfk
r$qlqlXqlW|S(u�
    Return a list of accepted, denied, unaccepted and rejected keys.
    This is the same output as `salt-key -L`

    CLI Example:

    .. code-block:: bash

        salt 'master' minion.list
    u
config.getupki_diruu	transportuminionumasteruzeromqutcpu.(uzeromqutcp(t__salt__treplacet_check_minions_directoriest"_check_minions_directories_raetkeytostpathtbasenametsalttutilstdatatsorted_ignorecasetlistdirt
startswithtisfiletjointappendtOSErrortIOError(tpki_dirt	transporttkey_dirstrettdir_tfn_((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pytlist_s"
%!+cC@s�tjj|tjjj�}tjj|tjjj�}tjj|tjjj�}tjj|tjjj	�}||||fS(uz
    Return the minion keys directory paths.

    This function is a copy of salt.key.Key._check_minions_directories.
    (
R	R
RRtkeytKeytACCtPENDtREJtDEN(Rtminions_acceptedtminions_pretminions_rejectedtminions_denied((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pyREs
cC@sgtjj|tjjj�}tjj|tjjj�}tjj|tjjj�}|||fS(u~
    Return the minion keys directory paths.

    This function is a copy of salt.key.RaetKey._check_minions_directories.
    (	R	R
RRRtRaetKeyR R!R"(Rtacceptedtpretrejected((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pyRSsicC@s5idd6dd6}g}tjd�}|sR|jd�tjjj|d<n�dtkr�|jd�tjjj|d<n�t	td|��|d<|dr�|jd�nhxet
|�D]7}tjd�td|�}|s�||d<Pq�q�W|jd	�tjjj
|d<|r1||d
<n|S(u�
    Kill the salt minion.

    timeout
        int seconds to wait for the minion to die.

    If you have a monitor that restarts ``salt-minion`` when it dies then this is
    a great way to restart after a minion upgrade.

    CLI example::

        >$ salt minion[12] minion.kill
        minion1:
            ----------
            killed:
                7874
            retcode:
                0
        minion2:
            ----------
            killed:
                29071
            retcode:
                0

    The result of the salt command shows the process ID of the minions and the
    results of a kill signal to the minion in as the ``retcode`` value: ``0``
    is success, anything else is a failure.
    ukillediuretcodeupiduUnable to find "pid" in grainsups.kill_piduMissing command: ps.kill_pidups.kill_pid failedu$Timed out waiting for minion to exitucommentN(tNonet
__grains__tgetRRtdefaultst	exitcodestEX_SOFTWARERtintRttimetsleeptEX_TEMPFAIL(ttimeoutRtcommenttpidt_tsignaled((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pytkill`s2







cC@st}t}g}idd6id6dd6}tdd�}|r||jd�|jg|D]}dj|�^q]�ndd	tjkr�tj}|jd
�|jg|D]}dj|�^q��nt}|jd�|rm|j	t
��d|krJ|drJt|dtj
�r6|j|d�qJ|j|d�n|drm|jd
�t}qmn|rtd|dtj�|d<d|dkr�|dd=n|djdd�r�|jd�|dd|d<nd|dkr|dd=qn|r||d<n|S(ua
    Kill and restart the salt minion.

    The configuration key ``minion_restart_command`` is an argv list for the
    command to restart the minion.  If ``minion_restart_command`` is not
    specified or empty then the ``argv`` of the current process will be used.

    if the configuration value ``minion_restart_command`` is not set and the
    ``-d`` (daemonize) argument is missing from ``argv`` then the minion
    *will* be killed but will *not* be restarted and will require the parent
    process to perform the restart.  This behavior is intended for managed
    salt minion processes.

    CLI example::

        >$ salt minion[12] minion.restart
        minion1:
            ----------
            comment:
                - Restart using process argv:
                -     /home/omniture/install/bin/salt-minion
                -     -d
                -     -c
                -     /home/omniture/install/etc/salt
            killed:
                10070
            restart:
                ----------
                stderr:
                stdout:
            retcode:
                0
        minion2:
            ----------
            comment:
                - Using configuration minion_restart_command:
                -     /home/omniture/install/bin/salt-minion
                -     --not-an-option
                -     -d
                -     -c
                -     /home/omniture/install/etc/salt
                - Restart failed
            killed:
                10896
            restart:
                ----------
                stderr:
                    Usage: salt-minion

                    salt-minion: error: no such option: --not-an-option
                stdout:
            retcode:
                64

    The result of the command shows the process ID of ``minion1`` that is
    shutdown (killed) and the results of the restart.  If there is a failure
    in the restart it will be reflected in a non-zero ``retcode`` and possibly
    output in the ``stderr`` and/or ``stdout`` values along with addition
    information in the ``comment`` field as is demonstrated with ``minion2``.
    ukilledurestartiuretcodeu
config.getuminion_restart_commandu+Using configuration minion_restart_command:u    {0}u-duRestart using process argv:uCNot running in daemon mode - will not restart process after killingucommentuKill failed - not restartingucmd.run_alltenvupiduRestart failedN(tTrueR,RRtextendtformattsystargvtFalsetupdateR;t
isinstanceRtstring_typesR	tenvironR.(tshould_killtshould_restartR7Rtrestart_cmdtarg((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pytrestart�sL>

,	
,




(t__doc__t
__future__RRRR	R@R3tsalt.utils.dataRtsalt.keytsalt.extRtsalt.ext.six.movesRt__func_alias__RRRR;RK(((s7/usr/lib/python2.7/site-packages/salt/modules/minion.pyt<module>s
	+		
F

Zerion Mini Shell 1.0