%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z e j e
� Z d � Z d d d d d � Z d d d � Z d S( 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 ( t absolute_importt unicode_literalst print_functionNc C@ s t j j j d � d k S( u-
Only load if RabbitMQ is installed.
u rabbitmqctlN( t saltt utilst patht whicht None( ( ( s? /usr/lib/python2.7/site-packages/salt/states/rabbitmq_policy.pyt __virtual__ s u /c
C@ s� i | d 6t d 6d d 6i d 6} i } t d d | d | � } | j | i � j | � }
g } |
rG|
j d � | k r� | j d
� n |
j d � } | r� t j | � n d } | r� t j | � n d }
| |
k r� | j d � n | r|
j d
� | k r| j d � n t |
j d � � | k rG| j d � qGn |
rn| rnd j | | � | d <| S|
s�| d j i i d 6| d 6� t d r�d j | | � | d <qtt
j d � t d | | | | d | d | d | �} n� | rt| d j i |
d 6| d 6� t d r9d j | | � | d <qtt
j d � t d | | | | d | d | d | �} n d | k r�t | d <| d | d <nZ | d i k r�d j | � | d <n4 t d r�d | d <n d | k r�| 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')
u nameu resultu u commentu changesu rabbitmq.list_policiest vhostt runasu patternu Patternu
definitionu
Definitionu apply-tou Applytou priorityu Priorityu! Policy {0} {1} is already presentu oldu newu testu# Policy {0} {1} is set to be createdu Policy doesn't exist - Creatingu rabbitmq.set_policyt priorityt apply_tou# Policy {0} {1} is set to be updatedu Policy exists but needs updatingu Erroru&