|
|
|
@ -93,9 +93,9 @@ for need_user in need:
|
|
|
|
|
elif 'password' in detail:
|
|
|
|
|
args = ['rabbitmqctl', 'change_password', username, detail['password']]
|
|
|
|
|
subprocess.check_call(args, stdout=sys.stderr)
|
|
|
|
|
# no "else", we have a user that exists, and no assertion about passwords. we
|
|
|
|
|
# don't want to generate a new password if this is just a user that we're
|
|
|
|
|
# setting user tags on.
|
|
|
|
|
# no "else", we have a user that exists, and no assertion about passwords.
|
|
|
|
|
# we don't want to generate a new password if this is just a user that
|
|
|
|
|
# we're setting user tags on.
|
|
|
|
|
if 'permissions' in detail:
|
|
|
|
|
args = ['rabbitmqctl', 'set_permissions', username]
|
|
|
|
|
args.append(detail['permissions']['conf'])
|
|
|
|
@ -113,13 +113,14 @@ if want - have:
|
|
|
|
|
LOG.error('Desired users missing: want=%s have=%s', want, have)
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
CLEAN_USERS = subprocess.Popen(['os-apply-config', '--key', 'rabbit.clean_users',
|
|
|
|
|
CLEAN_USERS = subprocess.Popen(['os-apply-config', '--key',
|
|
|
|
|
'rabbit.clean_users',
|
|
|
|
|
'--key-default', 'False'],
|
|
|
|
|
stdout=subprocess.PIPE).stdout.read()
|
|
|
|
|
|
|
|
|
|
if 'True' in CLEAN_USERS:
|
|
|
|
|
to_delete = have - want
|
|
|
|
|
for username in to_delete:
|
|
|
|
|
subprocess.check_call(['rabbitmqctl', 'delete_user', username], stdout=sys.stderr)
|
|
|
|
|
subprocess.check_call(['rabbitmqctl', 'delete_user', username],
|
|
|
|
|
stdout=sys.stderr)
|
|
|
|
|
LOG.debug("Deleted user %s" % username)
|
|
|
|
|
|
|
|
|
|