%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/raet_publish.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlmZddl
mZeje�ZdZd�Zd�Zdd	d
ddd
�Zdd	d
dd�Zdd	d
dd�Zddd�ZdS(u-
Publish a command from a minion to a target
i(tabsolute_importtunicode_literalstprint_functionN(tSaltReqTimeoutError(tsixupublishcC@s tjdd�dkrtStS(Nu	transportuuraet(t__opts__tgett__virtualname__tFalse(((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt__virtual__scC@sCtjjj|�}|dkr%gSt|t�s;|gS|SdS(uD
    yamlify `arg` and ensure it's outermost datatype is a list
    N(tsalttutilstargstyamlify_argtNonet
isinstancetlist(targt	yaml_args((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt_parse_argssuglobuiucleanc
C@sf|dkrtjd�iSt|�}i	dd6|d6|d6|d6|d6|d	6|d
6|d6tdd6}tjjjjt�}z�y|j	|�}	Wnt
k
r�d
j|�SX|	s�iStj
t|��idd6tdd6tj|	d�d6}|j	|�}
|dkrOi}x |
D]}|
|d	||<q/W|S|
SWd|j�XdS(u
    Publish a command from the minion out to other minions, publications need
    to be enabled on the Salt master and the minion needs to have permission
    to publish the command. The Salt master will also prevent a recursive
    publication loop, this means that a minion cannot command another minion
    to command another minion as that would create an infinite command loop.

    The arguments sent to the minion publish function are separated with
    commas. This means that for a minion executing a command with multiple
    args it will look like this::

        salt system.example.com publish.publish '*' user.add 'foo,1020,1020'

    CLI Example:

    .. code-block:: bash

        salt system.example.com publish.publish '*' cmd.run 'ls -la /tmp'
    upublish.publishu0Function name is 'publish.publish'. Returning {}u
minion_pubucmdufunuargutgtutgt_typeuretutmouformuidu'{0}' publish timed outupub_retujiducleanN(tlogtinfoRRR
t	transporttclientt
ReqChanneltfactorytsendRtformatttimetsleeptfloatRt	text_typetclose(
ttgttfunRttgt_typetreturnerttimeouttformtloadtchannelt	peer_datatrettcretthost((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt_publish+sB




c
C@s+t||d|d|d|d|dd�S(u1
    Publish a command from the minion out to other minions.

    Publications need to be enabled on the Salt master and the minion
    needs to have permission to publish the command. The Salt master
    will also prevent a recursive publication loop, this means that a
    minion cannot command another minion to command another minion as
    that would create an infinite command loop.

    The ``tgt_type`` argument is used to pass a target other than a glob into
    the execution, the available options are:

    - glob
    - pcre
    - grain
    - grain_pcre
    - pillar
    - pillar_pcre
    - ipcidr
    - range
    - compound

    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    The arguments sent to the minion publish function are separated with
    commas. This means that for a minion executing a command with multiple
    args it will look like this:

    .. code-block:: bash

        salt system.example.com publish.publish '*' user.add 'foo,1020,1020'
        salt system.example.com publish.publish 'os:Fedora' network.interfaces '' grain

    CLI Example:

    .. code-block:: bash

        salt system.example.com publish.publish '*' cmd.run 'ls -la /tmp'


    .. admonition:: Attention

        If you need to pass a value to a function argument and that value
        contains an equal sign, you **must** include the argument name.
        For example:

        .. code-block:: bash

            salt '*' publish.publish test.kwarg arg='cheese=spam'


    RR#R$R%R&uclean(R-(R!R"RR#R$R%((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pytpublishos<c
C@s+t||d|d|d|d|dd�S(u
    Return the full data about the publication, this is invoked in the same
    way as the publish function

    CLI Example:

    .. code-block:: bash

        salt system.example.com publish.full_data '*' cmd.run 'ls -la /tmp'

    .. admonition:: Attention

        If you need to pass a value to a function argument and that value
        contains an equal sign, you **must** include the argument name.
        For example:

        .. code-block:: bash

            salt '*' publish.full_data test.kwarg arg='cheese=spam'

    RR#R$R%R&ufull(R-(R!R"RR#R$R%((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt	full_data�scC@s�t|�}idd6|d6|d6|d6tdd6}tjjjjt�}z3y|j|�SWntk
r�dj	|�SXWd|j
�XdS(	u�
    Execute a runner on the master and return the data from the runner
    function

    CLI Example:

    .. code-block:: bash

        salt publish.runner manage.down
    u
minion_runnerucmdufunuargutmouidu'{0}' runner publish timed outN(RRR
RRRRRRRR (R"RR%R'R(((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pytrunner�s

(t__doc__t
__future__RRRRtloggingtsalt.payloadR
tsalt.utils.argstsalt.transport.clienttsalt.exceptionsRtsalt.extRt	getLoggert__name__RRR	RRR-R.R/R0(((s=/usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt<module>s4		?B

Zerion Mini Shell 1.0