1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

fw/config: better error when merging augs

If one or more entries for augmentations in configuration contains an
invalid value, raise ConfigError with the entry name.
This commit is contained in:
Sergei Trofimov 2018-03-22 12:19:47 +00:00 committed by Marc Bonnici
parent 3d7984412a
commit 72f2f82594

View File

@ -221,7 +221,16 @@ def merge_augmentations(raw):
cfg_point = JobSpec.configuration['augmentations']
names = [cfg_point.name,] + cfg_point.aliases
entries = [toggle_set(raw.pop(n)) for n in names if n in raw]
entries = []
for n in names:
if n not in raw:
continue
value = raw.pop(n)
try:
entries.append(toggle_set(value))
except TypeError as e:
msg = 'Invalid value "{}" for "{}": {}'
raise ConfigError(msg.format(value, n, e))
# Make sure none of the specified aliases conflict with each other
to_check = [e for e in entries]