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

mongodb_user: fix ssl_cert_reqs exception (#2573)

If ssl is not enabled, but ssl_cert_reqs is passed to pymongo, an
exception occures.

Fixes: #2571
This commit is contained in:
gyurco 2016-07-20 07:58:35 +02:00 committed by Matt Clay
parent 51eb68b4d7
commit 5c35d55b3c

View file

@ -299,6 +299,8 @@ def main():
user = module.params['name'] user = module.params['name']
password = module.params['password'] password = module.params['password']
ssl = module.params['ssl'] ssl = module.params['ssl']
ssl_cert_reqs = None
if ssl:
ssl_cert_reqs = getattr(ssl_lib, module.params['ssl_cert_reqs']) ssl_cert_reqs = getattr(ssl_lib, module.params['ssl_cert_reqs'])
roles = module.params['roles'] roles = module.params['roles']
state = module.params['state'] state = module.params['state']