From 3891a5baea6566bae6a3f0732139a77db8c4ac96 Mon Sep 17 00:00:00 2001 From: kfei Date: Fri, 30 May 2014 16:50:53 +0800 Subject: [PATCH] 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 --- ceph_deploy/mon.py | 3 +++ 1 file changed, 3 insertions(+) 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: -- 2.47.3