From fe03b051368261b4a0639c83f73673a4d902a9c7 Mon Sep 17 00:00:00 2001 From: David Waroquiers Date: Mon, 21 Aug 2023 16:24:54 +0200 Subject: [PATCH] Fixed state query in jobcontroller. --- src/jobflow_remote/jobs/jobcontroller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jobflow_remote/jobs/jobcontroller.py b/src/jobflow_remote/jobs/jobcontroller.py index 89b9267c..b86827de 100644 --- a/src/jobflow_remote/jobs/jobcontroller.py +++ b/src/jobflow_remote/jobs/jobcontroller.py @@ -139,7 +139,7 @@ def _build_query_wf( not_in_states = list(Firework.STATE_RANKS.keys()) not_in_states.remove("WAITING") query["fws.state"] = {"$nin": not_in_states} - if state == FlowState.PAUSED: + elif state == FlowState.PAUSED: not_in_states = list(Firework.STATE_RANKS.keys()) not_in_states.remove("PAUSED") query["fws.state"] = {"$nin": not_in_states} @@ -162,6 +162,8 @@ def _build_query_wf( } }, ] + else: + raise RuntimeError("Unknown flow state.") # at variance with Firework doc, the dates in the Workflow are Date objects if start_date: