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

�
���^c@@sdZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlZddlm
Z
mZeje�ZdZd�Zd�Zddd	d
dedd�Zddd	d
dd
�Zddd	d
d�Zdd
d�ZdS(u-
Publish a command from a minion to a target
i(tabsolute_importtunicode_literalstprint_functionN(tSaltReqTimeoutErrortSaltInvocationErrorupublishcC@s tjdd�dkrtStS(Nu	transportuuzeromqutcp(uzeromqutcp(t__opts__tgett__virtualname__tFalse(((s8/usr/lib/python2.7/site-packages/salt/modules/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((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pyt_parse_argssuglobuiucleanc	C@s�dtkrtjd�iS|jd�r=tjd�iSt|�}|r�dtkrmtdd��q	gtdD]!}	dj|�|	krx|	^qx}
|
s�td	j|td���nt|
�d
kr�tj	d|td�n|
j
�}n
td}tjd||�tjj
t�}|jd
�}
idd6|d6|d6|d6|d6|d6|
d6|d6|d6tdd6tjdg�d6}tjjjjtd|�}zy|j|�}Wntk
r�dj|�SX|s�iS|r9d}t|d�}t�}d}x�t||A�dkr5idd6tdd6|
d6|d d 6}|j|�}t|j��}t}||kr�t}n/|||kr�t|�d
kr�iSt}n|r|d!kri}x |D]}||d||<q�W|S|Sn|d
}tj|�q*Wn�tjt|��idd6tdd6|
d6|d d 6}|j|�}|d!kr�i}x |D]}||d||<q�W|S|SWd"|j�Xd"S(#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'
    u
master_uriuSCannot run publish commands without a connection to a salt master. No command sent.upublish.u*Cannot publish publish calls. Returning {}umaster_uri_listtmessageujCould not find list of masters                     in minion configuration but `via_master` was specified.u//{0}:umCould not find match for {0} in                 list of configured masters {1} when using `via_master` optioniu]The `via_master` flag found more than one possible match found for %s when evaluating list %suPublishing '%s' to %sR
u
minion_pubucmdufunuargutgtutgt_typeuretutokutmouformuiduno_parset
master_uriu'{0}' publish timed outg333333�?uminionsiupub_retujiducleanN(Rtlogterrort
startswithtinfoRRtformattlentwarningtpopR
tcrypttSAutht	gen_tokenRt	transporttclientt
ReqChanneltfactorytsendRtsettkeysRtTruettimetsleeptfloattclose(ttgttfunRttgt_typetreturnerttimeouttformtwaitt
via_mastertmastertmatching_master_urisRtauthttoktloadtchannelt	peer_datat
loop_intervaltmatched_minionstreturned_minionstloop_countertrettend_looptcretthost((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pyt_publish)s�

	


	
		



cC@s7t||d|d|d|d|dddtd|�S(	uh
    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``.

    Note that for pillar matches must be exact, both in the pillar matcher
    and the compound matcher. No globbing is 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:

    .. 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'

        Multiple keyword arguments should be passed as a list.

        .. code-block:: bash

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


    When running via salt-call, the `via_master` flag may be set to specific which
    master the publication should be sent to. Only one master may be specified. If
    unset, the publication will be sent only to the first master in minion configuration.
    RR/R0R1R2ucleanR3R4(RDR((R-R.RR/R0R1R4((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pytpublish�sIcC@s1t||d|d|d|d|dddt�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/R0R1R2ufullR3(RDR((R-R.RR/R0R1((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pyt	full_data
scC@s�t|�}dtkrdStjd|td�tjjt�}|jd�}idd6|d6|d6|d	6|d
6tdd6tjdg�d6}tj	j
jjt�}z3y|j
|�SWntk
r�d
j|�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
master_uriuDNo access to master. If using salt-call with --local, please remove.uPublishing runner '%s' to %sR
u
minion_runnerucmdufunuargutokutmouiduno_parseu'{0}' runner publish timed outN(RRRRR
RRR RR!R"R#R$R%RRR,(R.RR1R7R8R9R:((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pytrunner/s(

(t__doc__t
__future__RRRR)tloggingt
salt.cryptR
tsalt.payloadtsalt.utils.argstsalt.transport.clienttsalt.exceptionsRRt	getLoggert__name__RRR	RRRRDRERFRG(((s8/usr/lib/python2.7/site-packages/salt/modules/publish.pyt<module>s:		�P 

Zerion Mini Shell 1.0