From c3e4bdc9644203adafa9f92ac2554aa16a18015c Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 24 May 2018 13:41:39 +0100 Subject: [PATCH] config/core: Re-add `by_spec` reboot policy The `by_spec` reboot policy was removed in commit 0a549bd28e01a800566e9ad05a9420e1e4db3adc however this is still desirable so re-add. --- wa/framework/configuration/core.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wa/framework/configuration/core.py b/wa/framework/configuration/core.py index a012ce02..9a571a22 100644 --- a/wa/framework/configuration/core.py +++ b/wa/framework/configuration/core.py @@ -54,11 +54,12 @@ class RebootPolicy(object): :as_needed: Only reboot the device if it becomes unresponsive, or needs to be flashed, etc. :initial: The device will be rebooted when the execution first starts, just before executing the first workload spec. + :each_spec: The device will be rebooted before running a new workload spec. :each_iteration: The device will be rebooted before each new iteration. """ - valid_policies = ['never', 'as_needed', 'initial', 'each_job'] + valid_policies = ['never', 'as_needed', 'initial', 'each_spec', 'each_job'] @staticmethod def from_pod(pod): @@ -85,6 +86,10 @@ class RebootPolicy(object): def reboot_on_each_job(self): return self.policy == 'each_job' + @property + def reboot_on_each_spec(self): + return self.policy == 'each_spec' + def __str__(self): return self.policy @@ -599,6 +604,12 @@ class RunConfiguration(Configuration): ``"each_job"`` The device will be rebooted before each new job. + + ``"each_spec"`` + The device will be rebooted before running a new workload spec. + + .. note:: this acts the same as each_job when execution order + is set to by_iteration '''), ConfigurationPoint( 'device',