mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
PluginCache: Improve error message for ill-formed plugin config
Currently if you get confused and write a config with something like: energy_measurement: acme_cape Then you get an error when we try to 'iteritems' on the value 'acme_cape'. Instead, explicitly check for this case.
This commit is contained in:
parent
12edabf753
commit
016d68bfa0
@ -83,6 +83,10 @@ class PluginCache(object):
|
||||
msg = 'configuration provided for unknown plugin "{}"'
|
||||
raise ConfigError(msg.format(plugin_name))
|
||||
|
||||
if not hasattr(values, 'iteritems'):
|
||||
msg = 'Plugin configuration for "{}" not a dictionary ({} is {})'
|
||||
raise ConfigError(msg.format(plugin_name, repr(values), type(values)))
|
||||
|
||||
for name, value in values.iteritems():
|
||||
if (plugin_name not in GENERIC_CONFIGS and
|
||||
name not in self.get_plugin_parameters(plugin_name)):
|
||||
|
Loading…
x
Reference in New Issue
Block a user