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: v13.0.2~147^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3beee663f6fd6a16cef5a65ea5f9937cbea7a537;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 --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 74aceeaad44e..9993d8ae083c 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: