mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-07-20 05:53:29 +01: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:
@ -140,6 +140,9 @@ class AgendaParser(object):
|
|||||||
sections = raw.pop("sections", [])
|
sections = raw.pop("sections", [])
|
||||||
if not isinstance(sections, list):
|
if not isinstance(sections, list):
|
||||||
raise ConfigError('Invalid entry "sections" - must be a 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
|
return sections
|
||||||
|
|
||||||
def _pop_workloads(self, raw):
|
def _pop_workloads(self, raw):
|
||||||
|
Reference in New Issue
Block a user