From: Mykola Golub Date: Wed, 9 Jan 2019 09:29:56 +0000 (+0000) Subject: pybind/mgr/prometheus: improve 'rbd_stats_pools' param parsing X-Git-Tag: v14.1.0~450^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25860%2Fhead;p=ceph.git 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 --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 595e46a98a2e..ef6c08492db4 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: