From 1746324533a5f9bf9609cf0f0cc4879bbef112c7 Mon Sep 17 00:00:00 2001 From: Christopher Blum Date: Fri, 23 Feb 2018 18:48:49 +0100 Subject: [PATCH] pybind/mgr/prometheus: don't crash on OSDs without metadata 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 8f0e798d685..e02e982edc1 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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: -- 2.47.3