%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/beacons/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/beacons/smartos_imgadm.pyc

�
���^c@@s�dZddlmZmZddlZddlmZdZied6gd6Z	ej
e�Zd�Z
d	�Zd
�ZdS(u�
Beacon that fires events on image import/delete.

.. code-block:: yaml

    ## minimal
    # - check for new images every 1 second (salt default)
    # - does not send events at startup
    beacons:
      imgadm: []

    ## standard
    # - check for new images every 60 seconds
    # - send import events at startup for all images
    beacons:
      imgadm:
        - interval: 60
        - startup_import_event: True
i(tabsolute_importtunicode_literalsN(tmapuimgadmu	first_runuimagescC@s'dtkrtStdjt�fSdS(u+
    Provides imgadm beacon on SmartOS
    uimgadm.listu6{0} beacon can only be loaded on SmartOS compute nodesN(t__salt__tTruetFalsetformatt__virtualname__(((s?/usr/lib/python2.7/site-packages/salt/beacons/smartos_imgadm.pyt__virtual__(s
cC@s4t}d}t|t�s*t}d}n||fS(u+
    Validate the beacon configuration
    uValid beacon configurationu/Configuration for imgadm beacon must be a list!(Rt
isinstancetlistR(tconfigtvcfg_rettvcfg_msg((s?/usr/lib/python2.7/site-packages/salt/beacons/smartos_imgadm.pytvalidate7s	cC@s�g}tddt�}tdrstjd�i}tt|j|��d|ksc|drs|td<qsnxw|D]o}i}|tdkr�dj|�|d<x'||D]}|||||<q�Wn|rz|j	|�qzqzWxtdD]s}i}||krUd	j|�|d<x/td|D]}td||||<q2Wn|r�|j	|�q�q�W|td<tdr�t
td<n|S(
u2
    Poll imgadm and compare available images
    uimgadm.listtverboseu	first_runu(Applying configuration for imgadm beaconustartup_import_eventuimagesuimported/{}utagu
deleted/{}(RRtIMGADM_STATEtlogtinfoR
RtupdateRtappendR(Rtrettcurrent_imagest_configtuuidteventtlabel((s?/usr/lib/python2.7/site-packages/salt/beacons/smartos_imgadm.pytbeaconEs8





(t__doc__t
__future__RRtloggingtsalt.ext.six.movesRRRRt	getLoggert__name__RRRR(((s?/usr/lib/python2.7/site-packages/salt/beacons/smartos_imgadm.pyt<module>s
		

Zerion Mini Shell 1.0