From 3ca955c4d5f55c9c15797199b991dd0e81095386 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 20 Jan 2021 01:28:20 +0800 Subject: [PATCH] pybind/mgr/prometheus: add assert to appease mypy self.get_osd_perf_counters() might return None, add assert() to assure mypy that it does not return None here. Signed-off-by: Kefu Chai --- src/pybind/mgr/prometheus/module.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index e83bdd26eff..7eae269bf05 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -947,6 +947,7 @@ class Module(MgrModule): self.rbd_stats['query_id'] = query_id res = self.get_osd_perf_counters(self.rbd_stats['query_id']) + assert res for c in res['counters']: # if the pool id is not found in the object name use id of the # pool where the object is located -- 2.39.5