%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/states/ |
Current File : //lib/python2.7/site-packages/salt/states/beacon.pyc |
� ���^c @@ s{ d Z d d l m Z m Z m Z d d l m Z d d l Z e j e � Z e d � Z e d � Z d � Z d � Z d S( u Management of the Salt beacons ============================== .. versionadded:: 2015.8.0 .. code-block:: yaml ps: beacon.present: - save: True - enable: False - services: salt-master: running apache2: stopped sh: beacon.present: [] load: beacon.present: - averages: 1m: - 0.0 - 2.0 5m: - 0.0 - 1.5 15m: - 0.1 - 1.0 i ( t absolute_importt print_functiont unicode_literals( t sixNc K@ s� i | d 6t d 6i d 6g d 6} t d d t | � } g t j | � D] \ } } i | | 6^ qH } | | k r�| | | k r� | d j d j | � � q%t j d � r� t | d <t d | | | � } | d j | d � | d | d <q%t d | | | � } | d s5| d | d <| d | d <| Sd | k rl| d j d j | � � | d | d <q%| d j | d � n� t j d � r�t | d <t d | | | � } | d j | d � nZ t d | | | � } | d s| d | d <| d | d <| S| d j d j | � � | r�t j d � rW| d j d j | � � q�t d � } | d j d j | � � n d j | d � | d <| S( u� Ensure beacon is configured with the included beacon data. name The name of the beacon ensure is configured. save True/False, if True the beacons.conf file be updated too. Default is False. u nameu resultu changesu commentu beacons.listt return_yamlu Job {0} in correct stateu testu beacons.modifyu Modifying {0} in beaconsu beacons.addu Adding {0} to beaconsu Beacon {0} would be savedu beacons.saveu Beacon {0} savedu ( t Truet __salt__t FalseR t iteritemst appendt formatt __opts__t gett join( t namet savet kwargst rett current_beaconst kt vt beacon_datat result( ( s6 /usr/lib/python2.7/site-packages/salt/states/beacon.pyt present, sP / c K@ ss i | d 6t d 6i d 6g d 6} t d d t | � } | | k r� t j d � r� t | d <t d | | � } | d j | d � q� t d | | � } | d s� | d | d <| d | d <| S| d j d j | � � n | d j d j | � � | rXt j d � r.| d j d j | � � qXt d � } | d j d j | � � n d j | d � | d <| S( u� Ensure beacon is absent. name The name of the beacon ensured absent. save True/False, if True the beacons.conf file be updated too. Default is False. u nameu resultu changesu commentu beacons.listR u testu beacons.deleteu Removed {0} from beaconsu {0} not configured in beaconsu Beacon {0} would be savedu beacons.saveu Beacon {0} savedu ( R R R R R R R R ( R R R R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/states/beacon.pyt absentq s0 c K@ s i | d 6t d 6i d 6g d 6} t d d t | � } | | k r� t j d � r� t | d <t d | | � } | d j | d � q� t d | | � } | d s� | d | d <| d | d <| S| d j d j | � � n | d j d j | � � d j | d � | d <| S( uO Enable a beacon. name The name of the beacon to enable. u nameu resultu changesu commentu beacons.listR u testu beacons.enable_beaconu Enabled {0} from beaconsu {0} not a configured beaconu ( R R R R R R R R ( R R R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/states/beacon.pyt enabled� s&