From: Alfredo Deza Date: Mon, 9 Sep 2013 13:03:29 +0000 (-0400) Subject: catch a possible non-json response from the status command X-Git-Tag: v1.2.4~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=439098508dfd3dddbbe2eaccde95933cc83ab26e;p=ceph-deploy.git catch a possible non-json response from the status command Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index 1dfa655..e882414 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -32,7 +32,11 @@ def mon_status(conn, logger, hostname, silent=False): ['ceph', 'daemon', mon, 'mon_status'] ) - mon_info = json.loads(out) + try: + mon_info = json.loads(out) + except ValueError: + logger.warning('monitor: %s, might not be running yet' % mon) + return False if not silent: logger.debug('*'*80) logger.debug('status for monitor: %s' % mon)