]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/prometheus: add assert to appease mypy
authorKefu Chai <kchai@redhat.com>
Tue, 19 Jan 2021 17:28:20 +0000 (01:28 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 26 Jan 2021 10:02:24 +0000 (18:02 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/prometheus/module.py

index e83bdd26efffa4dcad480a53fdf3c8b3b0c3245c..7eae269bf055b02d7a10948600c333d7be726aa7 100644 (file)
@@ -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