Skip to content

Commit b13553f

Browse files
author
Tim Vaillancourt
committed
merging 2.4_optime_fix fix
2 parents f3f6bf2 + d13961b commit b13553f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MongoBackup/Replset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def find_secondary(self):
5858
'optime': member['optimeDate']
5959
}
6060
optime = member['optime']
61-
if 'ts' in member['optime']:
61+
if isinstance(member['optime'], dict) and 'ts' in member['optime']:
6262
optime = member['optime']['ts']
6363
logging.info("Found PRIMARY: %s/%s with optime %s" % (
6464
rs_name,
@@ -104,7 +104,7 @@ def find_secondary(self):
104104
log_msg = "Found SECONDARY %s/%s with too-high replication lag! Skipping" % (rs_name, member['name'])
105105

106106
log_data['optime'] = member['optime']
107-
if 'ts' in member['optime']:
107+
if isinstance(member['optime'], dict) and 'ts' in member['optime']:
108108
log_data['optime'] = member['optime']['ts']
109109
log_data['score'] = int(score)
110110
logging.info("%s: %s" % (log_msg, str(log_data)))

0 commit comments

Comments
 (0)