Skip to content
Snippets Groups Projects

lso result step title is now always the name of the provisioning step

Merged Karel van Klink requested to merge feature/update-lso-service into develop
1 file
+ 14
3
Compare changes
  • Side-by-side
  • Inline
+ 14
3
@@ -15,7 +15,7 @@ from orchestrator.utils.errors import ProcessFailureError
from orchestrator.workflow import Step, StepList, begin, callback_step, inputstep
from pydantic_forms.core import FormPage, ReadOnlyField
from pydantic_forms.types import FormGenerator
from pydantic_forms.validators import LongText
from pydantic_forms.validators import Label, LongText
from gso import settings
@@ -124,15 +124,22 @@ def _show_results(state: State) -> FormGenerator:
if "callback_result" not in state:
return state
if "lso_result_title" in state:
result_title = state["lso_result_title"]
else:
result_title = f"Execution for {state['subscription']['product']['name']} completed."
class ConfirmRunPage(FormPage):
class Config:
title: str = f"Execution for {state['subscription']['product']['name']} completed."
title: str = result_title
if "lso_result_extra_label" in state:
extra_label: Label = state["lso_result_extra_label"]
run_status: str = ReadOnlyField(state["callback_result"]["status"])
run_results: LongText = ReadOnlyField(json.dumps(state["callback_result"], indent=4))
yield ConfirmRunPage
state.pop("run_results")
[state.pop(key) for key in ["run_results", "lso_result_title", "lso_result_extra_label"]]
return state
@@ -143,6 +150,10 @@ def lso_interaction(provisioning_step: Step) -> StepList:
to provision service subscriptions. If the playbook fails, this step will also fail, allowing for the user to retry
provisioning from the UI.
Optionally, the keys ``lso_result_title`` and ``lso_result_extra_label`` can be added to the state before running
this interaction. They will be used to customise the input step that shows the outcome of the :term:`LSO`
interaction.
:param provisioning_step: A workflow step that performs an operation remotely using the provisioning proxy.
:type provisioning_step: :class:`Step`
:return: A list of steps that is executed as part of the workflow.
Loading