From a3646d31d688d0bddd18f08c238d3c65affcb4ee Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Fri, 1 Dec 2023 15:26:25 +0100 Subject: [PATCH] fix restart logic requiring SA_RESTARTABLE --- .../plainbox/impl/session/assistant.py | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/checkbox-ng/plainbox/impl/session/assistant.py b/checkbox-ng/plainbox/impl/session/assistant.py index 698009341..6168fa6ea 100644 --- a/checkbox-ng/plainbox/impl/session/assistant.py +++ b/checkbox-ng/plainbox/impl/session/assistant.py @@ -201,18 +201,16 @@ def __init__( self.get_old_sessions: ("get previously created sessions"), self.delete_sessions: ("delete previously created sessions"), self.finalize_session: "to finalize session", + self.configure_application_restart: ( + "configure automatic restart capability" + ), + self.use_alternate_restart_strategy: ( + "configure automatic restart capability" + ), } # Restart support self._restart_cmd_callback = None self._restart_strategy = None # None implies auto-detection - if SA_RESTARTABLE in self._flags: - allowed_calls = UsageExpectation.of(self).allowed_calls - allowed_calls[ - self.configure_application_restart - ] = "configure automatic restart capability" - allowed_calls[ - self.use_alternate_restart_strategy - ] = "configure automatic restart capability" @property def config(self): @@ -519,15 +517,13 @@ def start_new_session( self.get_session_id: "to get the id of currently running session", self.hand_pick_jobs: "select jobs to run (w/o a test plan)", self.finalize_session: "to finalize session", + self.configure_application_restart: ( + "configure automatic restart capability" + ), + self.use_alternate_restart_strategy: ( + "configure automatic restart capability" + ), } - if SA_RESTARTABLE in self._flags: - allowed_calls = UsageExpectation.of(self).allowed_calls - allowed_calls[ - self.configure_application_restart - ] = "configure automatic restart capability" - allowed_calls[ - self.use_alternate_restart_strategy - ] = "configure automatic restart capability" @raises(KeyError, UnexpectedMethodCall) def resume_session(