Skip to content

Commit

Permalink
fix restart logic requiring SA_RESTARTABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
kissiel committed Dec 1, 2023
1 parent 5a54d7f commit a3646d3
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions checkbox-ng/plainbox/impl/session/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a3646d3

Please sign in to comment.