Merge pull request #46973 from rallytime/fix-46880

New "apply_to" kwarg in rabbitmq module should be added at the end
This commit is contained in:
Nicole Thomas 2018-04-10 10:42:31 -04:00 committed by GitHub
commit fbbcb7584c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View file

@ -850,7 +850,13 @@ def list_policies(vhost="/", runas=None):
return ret
def set_policy(vhost, name, pattern, definition, priority=None, apply_to=None, runas=None):
def set_policy(vhost,
name,
pattern,
definition,
priority=None,
runas=None,
apply_to=None):
'''
Set a policy based on rabbitmqctl set_policy.

View file

@ -36,10 +36,10 @@ def __virtual__():
def present(name,
pattern,
definition,
apply_to=None,
priority=0,
vhost='/',
runas=None):
runas=None,
apply_to=None):
'''
Ensure the RabbitMQ policy exists.
@ -53,12 +53,12 @@ def present(name,
A json dict describing the policy
priority
Priority (defaults to 0)
apply_to
Apply policy to 'queues', 'exchanges' or 'all' (default to 'all')
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')
'''
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
result = {}
@ -90,9 +90,9 @@ def present(name,
name,
pattern,
definition,
apply_to,
priority=priority,
runas=runas)
runas=runas,
apply_to=apply_to)
elif updates:
ret['changes'].update({'old': policy, 'new': updates})
if __opts__['test']:
@ -103,9 +103,9 @@ def present(name,
name,
pattern,
definition,
apply_to,
priority=priority,
runas=runas)
runas=runas,
apply_to=apply_to)
if 'Error' in result:
ret['result'] = False