From a13e2052801c7a13bc988b1f413e7ed7b060891e Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 18 May 2018 17:00:56 +0100 Subject: [PATCH] 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. --- wa/framework/configuration/core.py | 2 +- wa/framework/configuration/parsers.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wa/framework/configuration/core.py b/wa/framework/configuration/core.py index 93db1b53..f5111fde 100644 --- a/wa/framework/configuration/core.py +++ b/wa/framework/configuration/core.py @@ -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 diff --git a/wa/framework/configuration/parsers.py b/wa/framework/configuration/parsers.py index de45611d..3ed801b8 100644 --- a/wa/framework/configuration/parsers.py +++ b/wa/framework/configuration/parsers.py @@ -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