%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/states/ |
Current File : //usr/lib/python2.7/site-packages/salt/states/loop.pyc |
� ���^c @@ st d Z d d l m Z m Z m Z d d l Z d d l Z e j e � Z d Z d � Z d d d d d d � Z d S( u� Loop state Allows for looping over execution modules. .. versionadded:: 2017.7.0 .. code-block:: yaml wait_for_service_to_be_healthy: loop.until: - name: boto_elb.get_instance_health - condition: m_ret[0]['state'] == 'InService' - period: 5 - timeout: 20 - m_args: - {{ elb }} - m_kwargs: keyid: {{ access_key }} key: {{ secret_key }} instances: "{{ instance }}" .. warning:: This state allows arbitrary python code to be executed through the condition parameter which is literally evaluated within the state. Please use caution. i ( t absolute_importt print_functiont unicode_literalsNu loopc C@ s t S( N( t True( ( ( s4 /usr/lib/python2.7/site-packages/salt/states/loop.pyt __virtual__+ s i�: c @ sW i | d 6i d 6t d 6d d 6} | t k rE d j | � | d <| S| d k r_ d | d <| St | t � s| d | d <| St � t � s� d | d <| St d r� d j | � | d <d | d <| S� f d � } t j � � � xZ | � s?t | | | � } t | � r/t | d <d j | � | d <| St j | � q� Wd j | � | d <| S( u Loop over an execution module until a condition is met. name The name of the execution module m_args The execution module's positional arguments m_kwargs The execution module's keyword arguments condition The condition which must be met for the loop to break. This should contain ``m_ret`` which is the return from the execution module. period The number of seconds to wait between executions timeout The timeout in seconds u nameu changesu resultu u commentu Cannot find module {0}u# An exit condition must be specifiedu1 Period must be specified as an integer in secondsu2 Timeout must be specified as an integer in secondsu testu$ The execution module {0} will be runc @ s t j � � k r t St S( N( t timeR t False( ( t timeout( s4 /usr/lib/python2.7/site-packages/salt/states/loop.pyt timed_outb s u Condition {0} was metu) Timed out while waiting for condition {0}N( R t __salt__t formatt Nonet isinstancet intt __opts__R t evalR t sleep( t namet m_argst m_kwargst conditiont periodR t retR t m_ret( ( R s4 /usr/lib/python2.7/site-packages/salt/states/loop.pyt until/ s>