]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
brag: Assume there are 0 MDS instead of crashing when data is missing
authorOleh Prypin <oleh@pryp.in>
Wed, 29 Jun 2016 21:51:50 +0000 (00:51 +0300)
committerOleh Prypin <oleh@pryp.in>
Thu, 30 Jun 2016 13:29:16 +0000 (16:29 +0300)
Signed-off-by: Oleh Prypin <oleh@pryp.in>
src/brag/client/ceph-brag

index ba785e37785b0a5227b4bcd78a58413cd1ab7cd1..006f076c5c58a42c93faf09e5a1b43f25b9b30d6 100755 (executable)
@@ -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']