%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z e j e � Z d Z d � Z d � Z d d d d d d � Z d d d d d � Z d d d d d � Z d d d � Z d S( u- Publish a command from a minion to a target i ( t absolute_importt unicode_literalst print_functionN( t SaltReqTimeoutError( t sixu publishc C@ s t j d d � d k r t St S( Nu transportu u raet( t __opts__t gett __virtualname__t False( ( ( s= /usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt __virtual__ s c C@ sC t j j j | � } | d k r% g St | t � s; | g S| Sd S( uD yamlify `arg` and ensure it's outermost datatype is a list N( t saltt utilst argst yamlify_argt Nonet isinstancet list( t argt yaml_args( ( s= /usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt _parse_args s u globu i u cleanc C@ sf | d k r t j d � i St | � } i d d 6| d 6| d 6| d 6| d 6| d 6| d 6| d 6t d d 6} t j j j j t � } z� y | j | � } Wn t k r� d j | � SX| s� i St j t | � � i d d 6t d d 6t j | d � d 6} | j | � } | d k rOi } 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 publish.publishu0 Function name is 'publish.publish'. Returning {}u minion_pubu cmdu funu argu tgtu tgt_typeu retu tmou formu idu '{0}' publish timed outu pub_retu jidu cleanN( t logt infoR R R t transportt clientt ReqChannelt factoryt sendR t formatt timet sleept floatR t text_typet close( t tgtt funR t tgt_typet returnert timeoutt formt loadt channelt peer_datat rett crett host( ( s= /usr/lib/python2.7/site-packages/salt/modules/raet_publish.pyt _publish+ sB c C@ s+ t | | d | d | d | d | d d �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' R R# R$ R% R&