mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix mongodb_user
compatibility with MongoDB 2.2 (used in Debian 7).
This commit is contained in:
parent
1fd863cf5d
commit
47c8396598
1 changed files with 7 additions and 2 deletions
|
@ -81,11 +81,16 @@ author: Elliott Foster
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
try:
|
try:
|
||||||
from pymongo import MongoClient
|
|
||||||
from pymongo.errors import ConnectionFailure
|
from pymongo.errors import ConnectionFailure
|
||||||
from pymongo.errors import OperationFailure
|
from pymongo.errors import OperationFailure
|
||||||
|
from pymongo import MongoClient
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pymongo_found = False
|
try: # for older PyMongo 2.2
|
||||||
|
from pymongo import Connection as MongoClient
|
||||||
|
except ImportError:
|
||||||
|
pymongo_found = False
|
||||||
|
else:
|
||||||
|
pymongo_found = True
|
||||||
else:
|
else:
|
||||||
pymongo_found = True
|
pymongo_found = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue