From: Boris Ranto Date: Fri, 16 Feb 2018 03:53:39 +0000 (+0100) Subject: mgr/prometheus: Skip bogus entries X-Git-Tag: wip-pdonnell-testing-20180317.202121~240^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=965aaad5273eac311e4535559a0e0a9df8a39bee;p=ceph-ci.git mgr/prometheus: Skip bogus entries The osd data can contain bogus '-' entries, skip these when populating osd metadata and disk occupation. Signed-off-by: Boris Ranto --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 74aceeaad44..fec46138ae9 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -284,6 +284,12 @@ class Module(MgrModule): id_ = osd['osd'] p_addr = osd['public_addr'].split(':')[0] c_addr = osd['cluster_addr'].split(':')[0] + if p_addr == "-" or c_addr == "-": + self.log.info( + "Missing address metadata for osd {0}, skipping occupation" + " and metadata records for this osd".format(id_) + ) + continue dev_class = next((osd for osd in osd_devices if osd['id'] == id_)) self.metrics['osd_metadata'].set(1, ( c_addr,