Skip to content
Snippets Groups Projects
Commit 8083b839 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: Warn when name collision between regular setting and selector

parent 8d83e1dc
No related branches found
No related tags found
1 merge request!3BIP configuration system
......@@ -67,6 +67,8 @@ def nested_lookup(d, key):
if key[0] not in d:
raise KeyError()
if not isinstance(d, dict):
return d
d = d[key[0]]
......@@ -253,7 +255,15 @@ class Config:
val = nested_lookup(settings, pat)
except KeyError:
continue
# If an entry with a selector name as key is
# present, and is not a dictionary (e.g.
# "subject = 1"), this is probably an error
# in the config file, or the selectors the
# user has provided. Warn and carry on
if not isinstance(val, dict):
log.warning('Ignoring primitive selector value (%s = %s)',
pat, val)
continue
log.debug('Updating settings from selector: %s', pat)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment