From f1bdd75ffc8472fc095999eca5cdda30f68a57cc Mon Sep 17 00:00:00 2001 From: Mario Raciti <mario.raciti@inaf.it> Date: Fri, 22 Oct 2021 16:46:19 +0200 Subject: [PATCH] TMSS-1123: Add state transitions from 'unschedulable' to 'cancelled' and 'error' --- SAS/TMSS/backend/src/tmss/tmssapp/populate.py | 2 ++ SAS/TMSS/backend/test/test_utils.py | 1 + 2 files changed, 3 insertions(+) diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py index e7c757539af..9132ea1bf43 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py @@ -160,6 +160,8 @@ def populate_subtask_allowed_state_transitions(apps, schema_editor): SubtaskAllowedStateTransitions(old_state=SCHEDULING, new_state=SCHEDULED), SubtaskAllowedStateTransitions(old_state=SCHEDULING, new_state=UNSCHEDULABLE), SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=DEFINED), + SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=CANCELLED), + SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=ERROR), SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=STARTING), # this is an odd one, as most (all?) subtasks are queued before execution... SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=QUEUEING), SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=UNSCHEDULING), diff --git a/SAS/TMSS/backend/test/test_utils.py b/SAS/TMSS/backend/test/test_utils.py index 86ac97ee5d7..9c8fe9aedcb 100644 --- a/SAS/TMSS/backend/test/test_utils.py +++ b/SAS/TMSS/backend/test/test_utils.py @@ -109,6 +109,7 @@ def set_subtask_state_following_allowed_transitions(subtask: typing.Union[Subtas SubtaskState.Choices.QUEUEING.value, SubtaskState.Choices.STARTING.value, SubtaskState.Choices.FINISHING.value, + SubtaskState.Choices.UNSCHEDULABLE.value, SubtaskState.Choices.CANCELLING.value): subtask.state = SubtaskState.objects.get(value=SubtaskState.Choices.ERROR.value) subtask.error_reason = 'set_subtask_state_following_allowed_transitions' -- GitLab