From: Nathan Cutler Date: Tue, 20 Nov 2018 12:45:11 +0000 (+0100) Subject: mgr: Ignore daemon if no metadata was returned X-Git-Tag: v12.2.11~137^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ecda0d8d0ab7b18d28b283a0ef8db4f2f032589e;p=ceph.git mgr: Ignore daemon if no metadata was returned It can happen that the Mgr does not return any metadata for a given daemon as it might not be available at that moment. None is returned by the get_metadata() method at that moment and both the Influx and Telegraf module should then ignore the daemon in their statistics and continue on to the next daemon. Signed-off-by: Wido den Hollander (manual cherry-pick of 02569c88341a6dcc8aee5626f10ac2927c2cf064) Signed-off-by: Nathan Cutler --- diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index 96eb33ce54a6..b1f369d22f37 100644 --- a/src/pybind/mgr/influx/module.py +++ b/src/pybind/mgr/influx/module.py @@ -114,6 +114,8 @@ class Module(MgrModule): for daemon, counters in six.iteritems(self.get_all_perf_counters()): svc_type, svc_id = daemon.split(".", 1) metadata = self.get_metadata(svc_type, svc_id) + if not metadata: + continue for path, counter_info in counters.items(): if counter_info['type'] & self.PERFCOUNTER_HISTOGRAM: