From: Oleh Prypin Date: Wed, 29 Jun 2016 21:51:50 +0000 (+0300) Subject: brag: Assume there are 0 MDS instead of crashing when data is missing X-Git-Tag: ses5-milestone5~522^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d4d2787e539bb7a66a647dcfa7b01502e31b9f1;p=ceph.git brag: Assume there are 0 MDS instead of crashing when data is missing Signed-off-by: Oleh Prypin --- diff --git a/src/brag/client/ceph-brag b/src/brag/client/ceph-brag index ba785e37785b..006f076c5c58 100755 --- a/src/brag/client/ceph-brag +++ b/src/brag/client/ceph-brag @@ -245,7 +245,10 @@ def get_nums(): oj = json.loads(o) num_mons = len(oj['monmap']['mons']) num_osds = int(oj['osdmap']['osdmap']['num_in_osds']) - num_mdss = oj['mdsmap']['in'] + try: + num_mdss = oj['mdsmap']['in'] + except KeyError: + num_mdss = 0 pgmap = oj['pgmap'] num_pgs = pgmap['num_pgs']