Skip to content

Commit 0951130

Browse files
add better error message when mandatory key is missing from a dictionary easyconfig parameter
1 parent f6bb651 commit 0951130

File tree

1 file changed

+2
-0
lines changed
  • easybuild/framework/easyconfig/format

1 file changed

+2
-0
lines changed

easybuild/framework/easyconfig/format/one.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def _reformat_line(self, param_name, param_val, outer=False, addlen=0):
161161
if isinstance(param_val, dict):
162162
ordered_item_keys = REFORMAT_ORDERED_ITEM_KEYS.get(param_name, sorted(param_val.keys()))
163163
for item_key in ordered_item_keys:
164+
if item_key not in param_val:
165+
raise EasyBuildError("Missing mandatory key '%s' in %s.", item_key, param_name)
164166
item_val = param_val[item_key]
165167
comment = self._get_item_comments(param_name, item_val).get(str(item_val), '')
166168
key_pref = quote_py_str(item_key) + ': '

0 commit comments

Comments
 (0)