Skip to content

Commit 4630bac

Browse files
author
A. Jesse Jiryu Davis
committed
More debug output from ha_tools
1 parent 402fa11 commit 4630bac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/high_availability/ha_tools.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,19 @@ def kill_all_secondaries(sig=2):
363363
def stepdown_primary():
364364
primary = get_primary()
365365
if primary:
366+
if ha_tools_debug:
367+
print 'stepping down primary:', primary
366368
c = pymongo.MongoClient(primary, use_greenlets=use_greenlets)
367369
# replSetStepDown causes mongod to close all connections
368370
try:
369371
c.admin.command('replSetStepDown', 20)
370-
except:
371-
pass
372+
except Exception, e:
373+
if ha_tools_debug:
374+
print 'Exception from replSetStepDown:', e
375+
if ha_tools_debug:
376+
print '\tcalled replSetStepDown'
377+
elif ha_tools_debug:
378+
print 'stepdown_primary() found no primary'
372379

373380

374381
def set_maintenance(member, value):

0 commit comments

Comments
 (0)