From 261417a9db89e859eceaf97d33ae24a5584bc895 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 26 Sep 2017 17:15:42 +0100 Subject: [PATCH] framework/configuration: fix workload config with multiple sections When an agenda contains multiple sections, the same workload entry might be used in construction of multiple job specs. Job spec construction may mangle the workload entry. To prevent this from impacting other jobs, use a deep copy of the workload entry when constructing a job spec. --- wa/framework/configuration/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wa/framework/configuration/core.py b/wa/framework/configuration/core.py index 7344dd7d..b5ae7e83 100644 --- a/wa/framework/configuration/core.py +++ b/wa/framework/configuration/core.py @@ -14,7 +14,7 @@ import os import re -from copy import copy +from copy import copy, deepcopy from collections import OrderedDict, defaultdict from wa.framework.exception import ConfigError, NotFoundError @@ -1042,7 +1042,7 @@ class JobGenerator(object): sections.insert(0, ancestor) for workload_entry in workload_entries: - job_spec = create_job_spec(workload_entry, sections, + job_spec = create_job_spec(deepcopy(workload_entry), sections, target_manager, self.plugin_cache, self.disabled_instruments) if self.ids_to_run: