mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix connection function to mongo
connecting to mongo using "pymongo.connection.Connection" did not work on different versions of mongo. this change fixes the connection issue.
This commit is contained in:
parent
b1c98a38ed
commit
5d520c9377
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ def _connect(user=None, password=None, host=None, port=None, database='admin'):
|
|||
port = __salt__['config.option']('mongodb.port')
|
||||
|
||||
try:
|
||||
conn = pymongo.connection.Connection(host=host, port=port)
|
||||
conn = pymongo.MongoClient(host=host, port=port)
|
||||
mdb = pymongo.database.Database(conn, database)
|
||||
if user and password:
|
||||
mdb.authenticate(user, password)
|
||||
|
|
Loading…
Add table
Reference in a new issue