]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/prometheus: don't crash on OSDs without metadata
authorChristopher Blum <zeichenanonym@web.de>
Fri, 23 Feb 2018 17:48:49 +0000 (18:48 +0100)
committerBoris Ranto <branto@redhat.com>
Tue, 3 Apr 2018 16:36:06 +0000 (18:36 +0200)
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
(cherry picked from commit 3beee663f6fd6a16cef5a65ea5f9937cbea7a537)

src/pybind/mgr/prometheus/module.py

index 8f0e798d685cfbdd851978ce26ff125d62adbbd6..e02e982edc1d9093eb2a57659738649a7421c5c1 100644 (file)
@@ -350,6 +350,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: