mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
fbbcb7584c
2 changed files with 15 additions and 9 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue