From: kfei Date: Fri, 30 May 2014 08:50:53 +0000 (+0800) Subject: Add better status message when adding new monitors X-Git-Tag: v1.5.3~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3891a5baea6566bae6a3f0732139a77db8c4ac96;p=ceph-deploy.git Add better status message when adding new monitors The `time.sleep(2)` in the `mon_add` method is not enough in some cases. For example, when a low-spec slow VM acting as a monitor, it may still at the state of 'probing' after the 2-seconds sleep. But in such cases the `mon_status` method will just say the monitor *is not running*, it's kind of confusion. So maybe it would be better if provides user the current state of the newly added monitor in the log message. Signed-off-by: kfei --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index 9b18f65..404b2b3 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -99,6 +99,9 @@ def mon_status(conn, logger, hostname, args, silent=False): if out['rank'] >= 0: logger.info('monitor: %s is running' % mon) return True + if out['rank'] == -1 and out['state']: + logger.info('monitor: %s is currently at the state of %s' % (mon, out['state'])) + return True logger.info('monitor: %s is not running' % mon) return False except RuntimeError: