From 35340b2395a1ae6db2691bd98ae875622b70cb20 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 9 Jan 2019 09:29:56 +0000 Subject: [PATCH] pybind/mgr/prometheus: improve 'rbd_stats_pools' param parsing re.split can still produce a list with empty string elements (e.g. if 'rbd_stats_pools' is just an empty string) and we want to filter out those. Signed-off-by: Mykola Golub --- src/pybind/mgr/prometheus/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 595e46a98a2e3..ef6c08492db4f 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -555,7 +555,7 @@ class Module(MgrModule): # stats are collected for every namespace in the pool. pools_string = self.get_localized_module_option('rbd_stats_pools', '') pools = {} - for p in re.split('[\s,]+', pools_string): + for p in [x for x in re.split('[\s,]+', pools_string) if x]: s = p.split('/', 2) pool_name = s[0] if len(s) == 1: -- 2.39.5