]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/prometheus: improve 'rbd_stats_pools' param parsing 25860/head
authorMykola Golub <mgolub@suse.com>
Wed, 9 Jan 2019 09:29:56 +0000 (09:29 +0000)
committerMykola Golub <mgolub@suse.com>
Wed, 9 Jan 2019 09:34:45 +0000 (09:34 +0000)
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 <mgolub@suse.com>
src/pybind/mgr/prometheus/module.py

index 595e46a98a2e3e3e35b745f0b2b3c6c562179218..ef6c08492db4f598abd5ea798c406e74b8f4f219 100644 (file)
@@ -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: