1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

descriptor: Fix overriding of parameters

Make sure we only override parameters that are present in the current
config. This allows for connection parameters to be supplied for a
platform but only overridden if required for the connection.
This commit is contained in:
Marc Bonnici 2020-04-14 13:35:35 +01:00
parent 607cff4c54
commit a3cf2e5650

View File

@ -640,10 +640,16 @@ class DefaultTargetDescriptor(TargetDescriptor):
correesponding parameter in overrides'''
if not overrides:
return params
return [o if p.match(o.name) else p for o in overrides for p in params]
param_map = {p.name: p for p in params}
for override in overrides:
if override.name in param_map:
param_map[override.name] = override
# Return the list of overriden parameters
return list(param_map.values())
def _get_item(self, item_tuple):
cls, params, defaults, = item_tuple
cls, params, defaults = item_tuple
updated_params = self._override_params(params, defaults)
return cls, updated_params