From 00adb6e5d431577c609c96020c720bd162fefa41 Mon Sep 17 00:00:00 2001 From: Ryan Currah Date: Sat, 15 Oct 2016 02:46:40 -0400 Subject: [PATCH] Fix mongodb_user.py version detection logic (#3162) Fix mongodb_user.py version detection logic for mongo srv 2.6 and mongo driver 2.7. The wrong variable was used for detecting the mongo driver version. This fix resolves the error "(Note: you must use pymongo 2.7+ with MongoDB 2.6.. 2.6.11)" no matter what version of pymongo you had installed for mongodb 2.6. --- lib/ansible/modules/extras/database/misc/mongodb_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/database/misc/mongodb_user.py b/lib/ansible/modules/extras/database/misc/mongodb_user.py index 651e45a082e..bf0bbd32bdc 100644 --- a/lib/ansible/modules/extras/database/misc/mongodb_user.py +++ b/lib/ansible/modules/extras/database/misc/mongodb_user.py @@ -185,7 +185,7 @@ def check_compatibility(module, client): elif loose_srv_version >= LooseVersion('3.0') and loose_driver_version <= LooseVersion('2.8'): module.fail_json(msg=' (Note: you must use pymongo 2.8+ with MongoDB 3.0)') - elif loose_srv_version >= LooseVersion('2.6') and loose_srv_version <= LooseVersion('2.7'): + elif loose_srv_version >= LooseVersion('2.6') and loose_driver_version <= LooseVersion('2.7'): module.fail_json(msg=' (Note: you must use pymongo 2.7+ with MongoDB 2.6)') elif LooseVersion(PyMongoVersion) <= LooseVersion('2.5'):