%PDF- %PDF-
| Direktori : /proc/self/root/lib/python2.7/site-packages/salt/client/ssh/wrapper/ |
| Current File : //proc/self/root/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyc |
�
���^c @@ s� d Z d d l m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z e j
e � Z d d d d d d d � Z d d d d d d � Z d d d d d d
� Z d d d � Z d S( 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 ( t absolute_importt print_functionNt globt t cleanc C@ s� | j d � r t j d � i S| r6 t j d � n | d k rK g } nR t | t � su t j j j
| � g } n( g | D] } t j j j
| � ^ q| } t | � d k r� | d d k r� g } n t j
t d � } t j
t � }
| j |
� | r
| | d <n | r| | d <n | g | | d <| | d
<| | d <| | d <t j j j | � } i } x! | j � D] }
| j |
� qtW| d
k r�i } xA | D]9 } d | | k r�| | d | | <q�| | | | <q�W| S| Sd S( 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'
s publish.s* Cannot publish publish calls. Returning {}s5 Returners currently not supported in salt-ssh publishi i t master_optst rostert timeoutt argvt selected_target_optiont tgtt argR t returnN( t
startswitht logt infot warningt Nonet
isinstancet listt saltt utilst argst yamlify_argt lent copyt deepcopyt __context__t __opts__t updatet clientt ssht SSHt run_iter( R
t funR t tgt_typet returnerR t formR t xt optst minoptsR t retst rett crett host( ( sC /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/publish.pyt _publish sF
("
i c C@ s1 t | | d | d | d | d | d d d | �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']"
R R# R$ R R% R R ( R- ( R
R"