From 79dec810f3b5fbeabafc1b964cd3e57c1e3ec465 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 4 Feb 2020 09:59:18 +0000 Subject: [PATCH] fw/plugin: move cleanup_assets to TargetedPlugin Move cleanup_assets from Workload up into TargetedPlugin. This way, Instruments may also utilize it if they deploy assets. More generally, it makes sense for it to be inside TargetedPlugin, as any plugin that interacts with the target may conceivably need to clean up. --- wa/framework/plugin.py | 10 ++++++++++ wa/framework/workload.py | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wa/framework/plugin.py b/wa/framework/plugin.py index 720fb6ff..dcf4df4a 100644 --- a/wa/framework/plugin.py +++ b/wa/framework/plugin.py @@ -384,6 +384,16 @@ class TargetedPlugin(Plugin): """ suppoted_targets = [] + parameters = [ + Parameter('cleanup_assets', kind=bool, + global_alias='cleanup_assets', + aliases=['clean_up'], + default=True, + description=""" + If ``True``, assets that are deployed or created by the + plugin will be removed again from the device. + """), + ] @classmethod def check_compatible(cls, target): diff --git a/wa/framework/workload.py b/wa/framework/workload.py index 7330d1ff..5e172e4a 100644 --- a/wa/framework/workload.py +++ b/wa/framework/workload.py @@ -44,14 +44,6 @@ class Workload(TargetedPlugin): kind = 'workload' parameters = [ - Parameter('cleanup_assets', kind=bool, - global_alias='cleanup_assets', - aliases=['clean_up'], - default=True, - description=""" - If ``True``, assets that are deployed or created as part of the - workload will be removed again from the device. - """), Parameter('uninstall', kind=bool, default=True, description="""