From 73a530917ae5887b5ae57bab43ff1b247978d565 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 21 Nov 2017 15:12:08 +0000 Subject: [PATCH] framework/workload: fix asset_files and deployed_assets These two lists are updated by workloads as assets are discovered and deployed. As these are defined as class attributes in the base Workload class, the same two list instances are shared between all classes. This results in subsequent workloads re-deploying assets from the previous workloads, and may lead to mismatches with deployable_assets, which is overwritten on per-workload basis. Make these into instance attriutes to prevent these issues. --- wa/framework/workload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wa/framework/workload.py b/wa/framework/workload.py index bb1c753b..71d1451b 100644 --- a/wa/framework/workload.py +++ b/wa/framework/workload.py @@ -66,8 +66,11 @@ class Workload(TargetedPlugin): # Used to store information about workload assets. deployable_assets = [] - asset_files = [] - deployed_assets = [] + + def __init__(self, target, **kwargs): + super(Workload, self).__init__(target, **kwargs) + self.asset_files = [] + self.deployed_assets = [] def init_resources(self, context): """