1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

avoid problem with old mongo version without roles

This commit is contained in:
Guillaume Dufour 2016-02-26 15:08:04 +01:00 committed by Matt Clay
parent b07e1c13f7
commit 467d9a8090

View file

@ -278,7 +278,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)
if module.check_mode: