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

fw/configuration: Allow for numerical ids to be used

Previously WA would fail if a purely numerical id was used, now
explicitly convert the id to a string before use.
This commit is contained in:
Marc Bonnici 2018-05-18 17:00:56 +01:00 committed by setrofim
parent 2abfe68b07
commit a13e205280
2 changed files with 2 additions and 1 deletions

View File

@ -869,7 +869,7 @@ class JobSpec(Configuration):
self.runtime_parameters = target_manager.merge_runtime_parameters(runtime_parameters)
def finalize(self):
self.id = "-".join([source.config['id']
self.id = "-".join([str(source.config['id'])
for source in self._sources[1:]]) # ignore first id, "global"
# ensure *_parameters are always obj_dict's

View File

@ -322,6 +322,7 @@ def _construct_valid_entry(raw, seen_ids, prefix, jobs_config):
def _collect_valid_id(entry_id, seen_ids, entry_type):
if entry_id is None:
return
entry_id = str(entry_id)
if entry_id in seen_ids:
raise ConfigError('Duplicate {} ID "{}".'.format(entry_type, entry_id))
# "-" is reserved for joining section and workload IDs