From 7ef91928bcaba1ecc5719c8a3df529facfd78b46 Mon Sep 17 00:00:00 2001 From: abdul Date: Wed, 13 Apr 2016 16:48:35 -0700 Subject: [PATCH] pymongo 3 compatibility fix --- mongoctl/objects/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoctl/objects/server.py b/mongoctl/objects/server.py index 5973639..35d561e 100644 --- a/mongoctl/objects/server.py +++ b/mongoctl/objects/server.py @@ -546,7 +546,7 @@ def get_db(self, dbname, no_auth=False, username=None, password=None, # if we have the system user then always auth with it if local_user and users.is_system_user(local_user["username"]) and dbname != "local": local_db = self.get_db("local", retry=retry) - return local_db.connection[dbname] + return local_db.client.get_database(dbname) is_system_user = (login_user and users.is_system_user(login_user.get("username"))) @@ -562,7 +562,7 @@ def get_db(self, dbname, no_auth=False, username=None, password=None, not self.supports_local_users())): # if this passes then we are authed! admin_db = self.get_db("admin", retry=retry) - return admin_db.connection[dbname] + return admin_db.client.get_database(dbname) # no retries on local db, so if we fail to auth to local we always # attempt to use admin @@ -575,7 +575,7 @@ def get_db(self, dbname, no_auth=False, username=None, password=None, not auth_success and dbname != "admin"): admin_db = self.get_db("admin", retry=retry) - return admin_db.connection[dbname] + return admin_db.client.get_database(dbname) if auth_success: return db