From 3beee663f6fd6a16cef5a65ea5f9937cbea7a537 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 --- 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 74aceeaad44..9993d8ae083 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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: -- 2.47.3