diff options
-rwxr-xr-x | src/ceph-create-keys | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ceph-create-keys b/src/ceph-create-keys index bb3967c0879..23632dd2075 100755 --- a/src/ceph-create-keys +++ b/src/ceph-create-keys @@ -34,7 +34,17 @@ def wait_for_quorum(cluster, mon_id): time.sleep(1) continue - data = json.loads(out) + if out == '': + LOG.info('ceph-mon admin socket returned no data') + time.sleep(1) + continue + + try: + data = json.loads(out) + except: + LOG.info('failed to parse json %s', out) + sys.exit(errno.EINVAL) + state = data['state'] if state not in QUORUM_STATES: LOG.info('ceph-mon is not in quorum: %r', state) |