use python fallback to avoid error on old mongo version without roles

reviewable/pr18780/r1
Guillaume Dufour 10 years ago
parent 29daa6ffe0
commit c6ebfa5480

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

Loading…
Cancel
Save