Ignore whitespace around comma-separated config values

'inputs=/a, /b' was read as '/a' and ' /b', so /b was skipped, and
excluded patterns with spaces around them never matched. Strip
whitespace from each value, and ignore empty exclude entries.
This commit is contained in:
Fuxino
2026-10-08 18:03:18 +02:00
parent 5189910131
commit d79ea56c0f
+2 -2
View File
@@ -753,7 +753,7 @@ def _read_config(config_file, user: Optional[str] = None):
section = 'default'
inputs = config.get(section, 'inputs')
inputs = inputs.split(',')
inputs = [i.strip() for i in inputs.split(',')]
inputs = _expand_inputs(inputs, user)
inputs = list(set(inputs))
@@ -770,7 +770,7 @@ def _read_config(config_file, user: Optional[str] = None):
try:
exclude = config.get(section, 'exclude')
exclude = exclude.split(',')
exclude = [e.strip() for e in exclude.split(',') if e.strip() != '']
except configparser.NoOptionError:
exclude = []