mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Backport #14486 to 2014.7
This commit is contained in:
commit
41c90dbca5
@ -78,6 +78,11 @@ def present(name,
|
||||
|
||||
else:
|
||||
changes = {'old': '', 'new': ''}
|
||||
|
||||
# Get it into the correct format
|
||||
if tags and isinstance(tags, (list, tuple)):
|
||||
tags = ' '.join(tags)
|
||||
|
||||
if not user_exists:
|
||||
log.debug(
|
||||
"User doesn't exist - Creating")
|
||||
@ -91,7 +96,7 @@ def present(name,
|
||||
for vhost, perm in element.items():
|
||||
result = __salt__['rabbitmq.set_permissions'](
|
||||
vhost, name, perm[0], perm[1], perm[2], runas)
|
||||
changes['new'] += ' {0} {1} {2}'.format(vhost, name, tags)
|
||||
changes['new'] += tags
|
||||
elif force:
|
||||
log.debug('User exists and force is set - Overriding')
|
||||
if password is not None:
|
||||
@ -107,7 +112,7 @@ def present(name,
|
||||
result.update(__salt__['rabbitmq.set_user_tags'](
|
||||
name, tags, runas=runas)
|
||||
)
|
||||
changes['new'] += tags
|
||||
changes['new'] += ' Tags: {0}'.format(', '.join(tags))
|
||||
for element in perms:
|
||||
for vhost, perm in element.items():
|
||||
result.update(__salt__['rabbitmq.set_permissions'](
|
||||
|
Loading…
Reference in New Issue
Block a user