1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-03-22 10:38:37 +00:00

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.
This commit is contained in:
Marc Bonnici 2018-05-24 13:41:39 +01:00 committed by setrofim
parent 23946620d6
commit c3e4bdc964

View File

@ -54,11 +54,12 @@ class RebootPolicy(object):
:as_needed: Only reboot the device if it becomes unresponsive, or needs to be flashed, etc. :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 :initial: The device will be rebooted when the execution first starts, just before
executing the first workload spec. 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. :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 @staticmethod
def from_pod(pod): def from_pod(pod):
@ -85,6 +86,10 @@ class RebootPolicy(object):
def reboot_on_each_job(self): def reboot_on_each_job(self):
return self.policy == 'each_job' return self.policy == 'each_job'
@property
def reboot_on_each_spec(self):
return self.policy == 'each_spec'
def __str__(self): def __str__(self):
return self.policy return self.policy
@ -599,6 +604,12 @@ class RunConfiguration(Configuration):
``"each_job"`` ``"each_job"``
The device will be rebooted before each new 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( ConfigurationPoint(
'device', 'device',