From: Kefu Chai Date: Tue, 19 Jan 2021 17:28:20 +0000 (+0800) Subject: pybind/mgr/prometheus: add assert to appease mypy X-Git-Tag: v17.1.0~3164^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3ca955c4d5f55c9c15797199b991dd0e81095386;p=ceph.git 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 --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index e83bdd26efffa..7eae269bf055b 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