From 721d2f3d012753eac14ead3a04eb894214919f17 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:22:45 +0100 Subject: [PATCH] Update run mode in schema --- cylc/uiserver/schema.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/cylc/uiserver/schema.py b/cylc/uiserver/schema.py index 99933a74..38de421a 100644 --- a/cylc/uiserver/schema.py +++ b/cylc/uiserver/schema.py @@ -43,10 +43,11 @@ STRIP_NULL_DEFAULT, Subscriptions, WorkflowID, + WorkflowRunMode as RunMode, _mut_field, - sstrip, get_nodes_all ) +from cylc.flow.util import sstrip from cylc.uiserver.resolvers import ( Resolvers, list_log_files, @@ -81,29 +82,6 @@ async def mutator( return GenericResponse(result=res) -class RunMode(graphene.Enum): - """The mode to run a workflow in.""" - - Live = 'live' - Dummy = 'dummy' - DummyLocal = 'dummy-local' - Simulation = 'simulation' - - @property - def description(self): - if self == RunMode.Live: - return 'The normal default run mode' - if self == RunMode.Dummy: - return 'Replaces all *-script items with nothing' - if self == RunMode.DummyLocal: - return ( - 'Replaces all *-script items with nothing and sets' - ' platform = localhost for all tasks.' - ) - if self == RunMode.Simulation: - return 'Simulates job submission, does not run anything at all.' - - class CylcVersion(graphene.String): """A Cylc version identifier e.g. 8.0.0""" @@ -170,7 +148,7 @@ class Arguments: ''') ) mode = RunMode( - default_value=RunMode.Live.name # type: ignore[attr-defined] + default_value=RunMode.Live.name ) host = graphene.String( description=sstrip('''