-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Guys,
came to the issue this morning...
Existing code gives an error :
/opt/sensu/embedded/bin/check-mongodb.rb --user xxx --pass "xxx" -P 27017 -A replication_lag_percent
CRITICAL - General MongoDB Error: can't set attribute
python --version : 2.7.6
pymongo : 3.0.1
I manually updated the part of this code to fix it :
Before:
def set_read_preference(db):
if pymongo.version >= "2.2" and pymongo.version < "2.8":
pymongo.read_preferences.Secondary
else:
db.read_preference = pymongo.ReadPreference.SECONDARY
After:
def set_read_preference(db):
if pymongo.version >= "2.2":
pymongo.read_preferences.Secondary
else:
db.read_preference = pymongo.ReadPreference.SECONDARY
I'm not sure why this 2nd test was added but it does not seems to work consistently on all versions... I don't have the env to test various versions of pymongo... so let you guys decide how to address this one.
thanks
boutetnico and seuf
Metadata
Metadata
Assignees
Labels
No labels