mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Cleaning up some pep8 whitespace issues in mongodb_user
This commit is contained in:
parent
eaac295fb2
commit
c4852f6954
1 changed files with 9 additions and 9 deletions
|
@ -115,16 +115,16 @@ else:
|
|||
|
||||
def user_add(module, client, db_name, user, password, roles):
|
||||
try:
|
||||
db = client[db_name]
|
||||
if roles is None:
|
||||
db.add_user(user, password, False)
|
||||
else:
|
||||
try:
|
||||
db.add_user(user, password, None, roles=roles)
|
||||
except:
|
||||
module.fail_json(msg='"problem adding user; you must be on mongodb 2.4+ and pymongo 2.5+ to use the roles param"')
|
||||
db = client[db_name]
|
||||
if roles is None:
|
||||
db.add_user(user, password, False)
|
||||
else:
|
||||
try:
|
||||
db.add_user(user, password, None, roles=roles)
|
||||
except:
|
||||
module.fail_json(msg='"problem adding user; you must be on mongodb 2.4+ and pymongo 2.5+ to use the roles param"')
|
||||
except OperationFailure:
|
||||
return False
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue