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:
@@ -753,7 +753,7 @@ def _read_config(config_file, user: Optional[str] = None):
|
|||||||
section = 'default'
|
section = 'default'
|
||||||
inputs = config.get(section, 'inputs')
|
inputs = config.get(section, 'inputs')
|
||||||
|
|
||||||
inputs = inputs.split(',')
|
inputs = [i.strip() for i in inputs.split(',')]
|
||||||
inputs = _expand_inputs(inputs, user)
|
inputs = _expand_inputs(inputs, user)
|
||||||
inputs = list(set(inputs))
|
inputs = list(set(inputs))
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ def _read_config(config_file, user: Optional[str] = None):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
exclude = config.get(section, 'exclude')
|
exclude = config.get(section, 'exclude')
|
||||||
exclude = exclude.split(',')
|
exclude = [e.strip() for e in exclude.split(',') if e.strip() != '']
|
||||||
except configparser.NoOptionError:
|
except configparser.NoOptionError:
|
||||||
exclude = []
|
exclude = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user