%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/rabbitmq_policy.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZej	e
�Zd�Zddddd�Zddd�ZdS(u>
Manage RabbitMQ Policies
========================

:maintainer:    Benn Eichhorn <benn@getlocalmeasure.com>
:maturity:      new
:platform:      all

Example:

.. code-block:: yaml

    rabbit_policy:
      rabbitmq_policy.present:
        - name: HA
        - pattern: '.*'
        - definition: '{"ha-mode": "all"}'
i(tabsolute_importtunicode_literalstprint_functionNcC@stjjjd�dk	S(u-
    Only load if RabbitMQ is installed.
    urabbitmqctlN(tsalttutilstpathtwhichtNone(((s?/usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pyt__virtual__su/c
C@s�i|d6td6dd6id6}i}tdd|d|�}	|	j|i�j|�}
g}|
rG|
jd	�|kr�|jd
�n|
jd�}|r�tj|�nd}|r�tj|�nd}
||
kr�|jd�n|r|
jd
�|kr|jd�nt|
jd��|krG|jd�qGn|
rn|rndj||�|d<|S|
s�|djiid6|d6�t	dr�dj||�|d<qtt
jd�td||||d|d|d|�}n�|rt|dji|
d6|d6�t	dr9dj||�|d<qtt
jd�td||||d|d|d|�}nd|kr�t|d<|d|d<nZ|dikr�dj|�|d<n4t	dr�d|d<nd|kr�|d|d<n|S( u�
    Ensure the RabbitMQ policy exists.

    Reference: http://www.rabbitmq.com/ha.html

    name
        Policy name
    pattern
        A regex of queues to apply the policy to
    definition
        A json dict describing the policy
    priority
        Priority (defaults to 0)
    vhost
        Virtual host to apply to (defaults to '/')
    runas
        Name of the user to run the command as
    apply_to
        Apply policy to 'queues', 'exchanges' or 'all' (default to 'all')
    unameuresultuucommentuchangesurabbitmq.list_policiestvhosttrunasupatternuPatternu
definitionu
Definitionuapply-touApplytoupriorityuPriorityu!Policy {0} {1} is already presentuoldunewutestu#Policy {0} {1} is set to be createduPolicy doesn't exist - Creatingurabbitmq.set_policytprioritytapply_tou#Policy {0} {1} is set to be updatedu Policy exists but needs updatinguErroru&'{0}' is already in the desired state.uSetN(tTruet__salt__tgettappendtjsontloadstinttformattupdatet__opts__tlogtdebugtFalseR(tnametpatternt
definitionRR	R
Rtrettresulttpoliciestpolicytupdatestcurrent_definitiontnew_definition((s?/usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pytpresent%sl"









cC@si|d6td6dd6id6}td||d|�}|s[dj||�|d<|Std	s�td
||d|�}d|kr�t|d<|d|d<|Sd|kr�d|d<q�nidd
6|d6|d<td	rd|d<dj||�|d<n|S(u�
    Ensure the named policy is absent

    Reference: http://www.rabbitmq.com/ha.html

    name
        The name of the policy to remove
    runas
        Name of the user to run the command as
    unameuresultuucommentuchangesurabbitmq.policy_existsR
u Policy '{0} {1}' is not present.utesturabbitmq.delete_policyuErroruDeletedunewuoldu!Policy '{0} {1}' will be removed.N(R
RRRRR(RR	R
Rt
policy_existsR((s?/usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pytabsents&
"



(t__doc__t
__future__RRRtloggingtsalt.utils.pathRRt	getLoggert__name__RRRR$R&(((s?/usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pyt<module>s	
U

Zerion Mini Shell 1.0