From 121fa3da951e6378ddd9d665d6b3f50f62dc10d4 Mon Sep 17 00:00:00 2001 From: Laura Flores Date: Wed, 2 Feb 2022 23:57:23 +0000 Subject: [PATCH] mgr/telemetry: compare len(values) to len(categories) This format will allow us to safely add or remove categories as needed in the future. Signed-off-by: Laura Flores (cherry picked from commit 5ac1dd6866287d9e5bc895a4028836d09c836069) --- src/pybind/mgr/telemetry/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 8ed73ffe5f61f..b107e3b8e32c3 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -427,7 +427,7 @@ class Module(MgrModule): 'spans_in_use', 'thread_heaps_in_use', 'tcmalloc_page_size'] - if len(values) != 12: + if len(values) != len(categories): self.log.debug('Received unexpected output from osd.{}; number of values should match the number of expected categories:\n' \ 'values: len={} {} ~ categories: len={} {} ~ outs: {}'.format(osd_id, len(values), values, len(categories), categories, outs)) continue -- 2.39.5