%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/zabbix_usermacro.pyo

�
���^c@@sWdZddlmZmZmZddlmZd�Zdd�Z	dd�Z
dS(uS
Management of Zabbix usermacros.
:codeauthor: Raymond Kuiper <qix@the-wired.net>

i(tabsolute_importtprint_functiontunicode_literals(tsixcC@s
dtkS(uI
    Only make these states available if Zabbix module is available.
    uzabbix.usermacro_create(t__salt__(((s@/usr/lib/python2.7/site-packages/salt/states/zabbix_usermacro.pyt__virtual__scK@s;i}d|kr#|d|d<nd|kr@|d|d<nd|kr]|d|d<ni|d6id6td6dd6}|rd	j||�}d
j||�}dj||�}dj||�}	iid
j||�d6d	j||�d6|6}
nidj|�}dj|�}dj|�}dj|�}	iidj|�d6dj|�d6|6}
d|kr�t|dt�r�dj|d�d|d<q�tj|d�d|d<n|r�td|d||�}ntd|dt|�}|rf|d}|r+t	|d�}
nt	|d�}
t}tj|�|dkrft}qfnt
dr�|r�|r�d%|d<||d<q�t|d<|	|d<nd%|d<||d<|Sg}|r}|rft|d<||d<|r
td|
d ||�}ntd!|
d ||�}t|t	�szd"|krR|j|d"�qc||dd<qzqt|d<|	|d<n�|r�td#||||�}ntd$|||�}d"|kr�t|d<||d<|
|d<n%t|d<|tj|d"�|d<|r7i|d<t|d<tj|�|d<n|S(&u

    Creates a new usermacro.

    :param name: name of the usermacro
    :param value: value of the usermacro
    :param hostid: id's of the hosts to apply the usermacro on, if missing a global usermacro is assumed.

    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    .. code-block:: yaml

        override host usermacro:
            zabbix_usermacro.present:
                - name: '{$SNMP_COMMUNITY}''
                - value: 'public'
                - hostid: 21

    u_connection_useru_connection_passwordu_connection_urlunameuchangesuresultuucommentu$Usermacro {0} created on hostid {1}.u$Usermacro {0} updated on hostid {1}.u/Unable to create usermacro: {0} on hostid {1}. u+Usermacro {0} already exists on hostid {1}.u+Usermacro {0} does not exist on hostid {1}.uoldunewuUsermacro {0} created.uUsermacro {0} updated.u!Unable to create usermacro: {0}. uUsermacro {0} already exists.uUsermacro {0} does not exist.uexec_paramsu
uzabbix.usermacro_getthostidstglobalmacroiuhostmacroidu
globalmacroiduvalueutestuzabbix.usermacro_updatetvalueuzabbix.usermacro_updateglobaluerroruzabbix.usermacro_createuzabbix.usermacro_createglobalN(
tFalsetformatt
isinstancetlisttjoinRt	text_typeRtTruetintt__opts__tNonetappend(tnameRthostidtkwargstconnection_argstrettcomment_usermacro_createdtcomment_usermacro_updatedtcomment_usermacro_notcreatedtcomment_usermacro_existstchanges_usermacro_createdtusermacro_existstusermacroobjtusermacroidtupdate_valueterrort
updated_valuetusermacro_create((s@/usr/lib/python2.7/site-packages/salt/states/zabbix_usermacro.pytpresents�"











	







cK@s�i}d|kr#|d|d<nd|kr@|d|d<nd|kr]|d|d<ni|d6id6td6dd6}|r�d	j||�}d
j||�}dj||�}iidj||�d
6dj||�d6|6}nZdj|�}dj|�}dj|�}iidj|�d
6dj|�d6|6}|rmtd|d||�}	ntd|dt|�}	tdr�|	s�t|d<||d<nd|d<||d<|S|	s�t|d<||d<n�yO|r|	dd}
td|
|�}n!|	dd}
td|
|�}Wntk
rJt}nX|r~d|kr~t|d<||d<||d<n%t|d<|tj|d�|d<|S(u�
    Ensures that the mediatype does not exist, eventually deletes the mediatype.

    :param name: name of the usermacro
    :param hostid: id's of the hosts to apply the usermacro on, if missing a global usermacro is assumed.

    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    .. code-block:: yaml

        delete_usermacro:
            zabbix_usermacro.absent:
                - name: '{$SNMP_COMMUNITY}'

    u_connection_useru_connection_passwordu_connection_urlunameuchangesuresultuucommentu&Usermacro {0} deleted from hostid {1}.u0Unable to delete usermacro: {0} from hostid {1}.u+Usermacro {0} does not exist on hostid {1}.u#Usermacro {0} exists on hostid {1}.uolduUsermacro {0} deleted from {1}.unewuUsermacro {0} deleted.u Unable to delete usermacro: {0}.uUsermacro {0} does not exist.uUsermacro {0} exists.uzabbix.usermacro_getRRutestiuhostmacroiduzabbix.usermacro_deleteu
globalmacroiduzabbix.usermacro_deleteglobaluerrorN(	R	R
RRRRtKeyErrorRR(RRRRRtcomment_usermacro_deletedtcomment_usermacro_notdeletedtcomment_usermacro_notexiststchanges_usermacro_deletedRR tusermacro_delete((s@/usr/lib/python2.7/site-packages/salt/states/zabbix_usermacro.pytabsent�s^"












N(t__doc__t
__future__RRRtsalt.extRRRR%R,(((s@/usr/lib/python2.7/site-packages/salt/states/zabbix_usermacro.pyt<module>s
	�

Zerion Mini Shell 1.0