]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/prometheus: don't crash on OSDs without metadata 20539/head
authorChristopher Blum <zeichenanonym@web.de>
Fri, 23 Feb 2018 17:48:49 +0000 (18:48 +0100)
committerChristopher Blum <zeichenanonym@web.de>
Fri, 23 Feb 2018 17:48:49 +0000 (18:48 +0100)
Fix issue where the ceph_exporter crashes after a Ceph upgrade with a broken OSD - that OSD was never online with Luminous and thus we have no metadata for it

Signed-off-by: Christopher Blum zeichenanonym@web.de
src/pybind/mgr/prometheus/module.py

index 74aceeaad44eaeabd31f363e6029dbda7314ab00..9993d8ae083c9029e0f6ff001e0adc242760be2c 100644 (file)
@@ -298,6 +298,8 @@ class Module(MgrModule):
                     ('osd.{}'.format(id_),))
 
             osd_metadata = self.get_metadata("osd", str(id_))
+            if osd_metadata is None:
+                continue
             dev_keys = ("backend_filestore_dev_node", "bluestore_bdev_dev_node")
             osd_dev_node = None
             for dev_key in dev_keys: