aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimov <sergei.trofimov@arm.com>2018-03-22 12:19:47 +0000
committerMarc Bonnici <marc.bonnici@arm.com>2018-03-22 12:28:48 +0000
commit72f2f8259480717c31d036047caf4380d1916121 (patch)
tree667819fd580aa5208fb6158fcfc3ffe5b4f2d6bd
parent3d7984412a5bd1a890057bbac629469a2376efb5 (diff)
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.
-rw-r--r--wa/framework/configuration/parsers.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wa/framework/configuration/parsers.py b/wa/framework/configuration/parsers.py
index 2dfe26a6..d959a8c8 100644
--- a/wa/framework/configuration/parsers.py
+++ b/wa/framework/configuration/parsers.py
@@ -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]