From: Christopher Blum Date: Fri, 23 Feb 2018 17:48:49 +0000 (+0100) Subject: pybind/mgr/prometheus: don't crash on OSDs without metadata X-Git-Tag: v12.2.5~58^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1746324533a5f9bf9609cf0f0cc4879bbef112c7;p=ceph.git 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) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 8f0e798d685c..e02e982edc1d 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: