File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 21
21
##############################################################################
22
22
23
23
import tools
24
- from pymongo import MongoClient , MongoReplicaSetClient
24
+ from pymongo import MongoClient
25
25
from pymongo .errors import AutoReconnect
26
26
from pymongo .read_preferences import ReadPreference
27
27
import re
@@ -158,7 +158,6 @@ def mongo_connect(self):
158
158
if tools .config ['mongodb_replicaset' ]:
159
159
kwargs .update ({'replicaSet' : tools .config ['mongodb_replicaset' ],
160
160
'read_preference' : ReadPreference .SECONDARY_PREFERRED })
161
- mongo_client = MongoReplicaSetClient
162
161
163
162
connection = mongo_client (self .uri , ** kwargs )
164
163
except Exception as e :
@@ -207,6 +206,7 @@ def get_db(self):
207
206
try :
208
207
db = self .connection [tools .config ['mongodb_name' ]]
209
208
except AutoReconnect :
209
+
210
210
max_tries = 5
211
211
count = 0
212
212
while count < max_tries :
Original file line number Diff line number Diff line change 1
- pymongo == 2.9
1
+ pymongo == 2.9 ;python_version < ="2.7.18"
2
+ pymongo >= 3.12 ;python_version > "2.7.18"
2
3
six
You can’t perform that action at this time.
0 commit comments