1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 11:58:55 +00:00

fw/parsers: Ensure that a section is a valid dict

Ensure that all section entries are valid dicts otherwise raise an error
informing the user.
This commit is contained in:
Marc Bonnici 2018-06-01 16:30:03 +01:00 committed by setrofim
parent 52243a5804
commit b15b937863

View File

@ -140,6 +140,9 @@ class AgendaParser(object):
sections = raw.pop("sections", [])
if not isinstance(sections, list):
raise ConfigError('Invalid entry "sections" - must be a list')
for section in sections:
if not hasattr(section, 'items'):
raise ConfigError('Invalid section "{}" - must be a dict'.format(section))
return sections
def _pop_workloads(self, raw):