From 7713f022526b19ce7081ba307b28fba044c6569c Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Fri, 26 Aug 2016 17:13:57 +0100 Subject: [PATCH] Execution: Added a `clean_up` global config to delete WA files from devices Adds a WA configuration point `clean_up` that will delete the WA binaries directory and the WA working directory from a device at the end of a WA run. --- wlauto/config_example.py | 3 +++ wlauto/core/configuration.py | 1 + wlauto/core/execution.py | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/wlauto/config_example.py b/wlauto/config_example.py index 032315ec..d4c24f56 100644 --- a/wlauto/config_example.py +++ b/wlauto/config_example.py @@ -54,6 +54,9 @@ retry_on_status = ['FAILED', 'PARTIAL'] # How many times a job will be re-run before giving up max_retries = 3 +# If WA should delete its files from the device after the run is completed +clean_up = False + #################################################################################################### ######################################### Device Settings ########################################## #################################################################################################### diff --git a/wlauto/core/configuration.py b/wlauto/core/configuration.py index f1d11db3..d879d40a 100644 --- a/wlauto/core/configuration.py +++ b/wlauto/core/configuration.py @@ -481,6 +481,7 @@ class RunConfiguration(object): RunConfigurationItem('flashing_config', 'dict', 'replace'), RunConfigurationItem('retry_on_status', 'list', 'replace'), RunConfigurationItem('max_retries', 'scalar', 'replace'), + RunConfigurationItem('clean_up', 'scalar', 'replace'), ] # Configuration specified for each workload spec. "workload_parameters" diff --git a/wlauto/core/execution.py b/wlauto/core/execution.py index 659c424f..0f3d9cd8 100644 --- a/wlauto/core/execution.py +++ b/wlauto/core/execution.py @@ -344,6 +344,11 @@ class Executor(object): runner = self._get_runner(result_manager) runner.init_queue(self.config.workload_specs) runner.run() + + if getattr(self.config, "clean_up", False): + self.logger.info('Clearing WA files from device') + self.device.delete_file(self.device.binaries_directory) + self.device.delete_file(self.device.working_directory) self.execute_postamble() def execute_postamble(self):