avoid problem with old mongo version without roles

reviewable/pr18780/r1
Guillaume Dufour 9 years ago
parent edbad80123
commit 29daa6ffe0

@ -265,7 +265,7 @@ def main():
uinfo = user_find(client, user, db_name)
if update_password != 'always' and uinfo:
password = None
if list(map((lambda x: x['role']), uinfo['roles'])) == roles:
if 'roles' in uinfo and list(map((lambda x: x['role']), uinfo['roles'])) == roles:
module.exit_json(changed=False, user=user)
try:

Loading…
Cancel
Save