This is less noise in the debug log. (Also, there seems to be a problem
when the mgr stat output gets too big.)
Signed-off-by: Sage Weil <sage@newdream.net>
# wait for mgr to restart (after enabling a module)
def wait_for_mgr_restart():
- # first get latest mgrmap epoch from the mon
- out = cli(['mgr', 'dump'])
+ # first get latest mgrmap epoch from the mon. try newer 'mgr
+ # stat' command first, then fall back to 'mgr dump' if
+ # necessary
+ try:
+ out = cli(['mgr', 'stat'])
+ except Exception as e:
+ out = cli(['mgr', 'dump'])
j = json.loads(out)
epoch = j['epoch']
# wait for mgr to have it