Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
10cd77c4
Verified
Commit
10cd77c4
authored
9 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Put LSO interactions inside a step group to reduce GUI clutter
parent
9ea08606
No related branches found
No related tags found
No related merge requests found
Pipeline
#89211
failed
9 months ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/lso_client.py
+20
-17
20 additions, 17 deletions
gso/services/lso_client.py
with
20 additions
and
17 deletions
gso/services/lso_client.py
+
20
−
17
View file @
10cd77c4
...
...
@@ -12,7 +12,7 @@ from orchestrator import step
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.types
import
State
from
orchestrator.utils.errors
import
ProcessFailureError
from
orchestrator.workflow
import
Step
,
StepList
,
begin
,
callback_step
,
inputstep
from
orchestrator.workflow
import
Step
,
begin
,
callback_step
,
inputstep
,
step_group
from
pydantic
import
ConfigDict
from
pydantic_forms.core
import
FormPage
from
pydantic_forms.types
import
FormGenerator
...
...
@@ -144,7 +144,7 @@ def _clean_state() -> State:
return
{
"
__remove_keys
"
:
[
"
run_results
"
,
"
lso_result_title
"
,
"
lso_result_extra_label
"
,
"
callback_result
"
]}
def
lso_interaction
(
provisioning_step
:
Step
)
->
Step
List
:
def
lso_interaction
(
provisioning_step
:
Step
)
->
Step
:
"""
Interact with the provisioning proxy :term:`LSO` using a callback step.
An asynchronous interaction with the provisioning proxy. This is an external system that executes Ansible playbooks
...
...
@@ -157,19 +157,20 @@ def lso_interaction(provisioning_step: Step) -> StepList:
: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.
:rtype: :class:`Step
List
`
:return: A
step group
that is executed as part of the workflow.
:rtype: :class:`Step`
"""
return
(
begin
return
step_group
(
name
=
provisioning_step
.
name
,
steps
=
begin
>>
callback_step
(
name
=
provisioning_step
.
name
,
action_step
=
provisioning_step
,
validate_step
=
_evaluate_results
)
>>
step
(
"
Inject result title
"
)(
lambda
:
{
"
lso_result_title
"
:
provisioning_step
.
name
})
>>
_show_results
>>
_clean_state
>>
_clean_state
,
)
def
indifferent_lso_interaction
(
provisioning_step
:
Step
)
->
Step
List
:
def
indifferent_lso_interaction
(
provisioning_step
:
Step
)
->
Step
:
"""
Interact with the provisioning proxy :term:`LSO` using a callback step.
This interaction is identical from the one described in ``lso_interaction()``, with one functional difference.
...
...
@@ -182,19 +183,20 @@ def indifferent_lso_interaction(provisioning_step: Step) -> StepList:
: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.
:rtype: :class:`Step
List
`
:return: A
step group
that is executed as part of the workflow.
:rtype: :class:`Step`
"""
return
(
begin
return
step_group
(
name
=
provisioning_step
.
name
,
steps
=
begin
>>
callback_step
(
name
=
provisioning_step
.
name
,
action_step
=
provisioning_step
,
validate_step
=
_ignore_results
)
>>
step
(
"
Inject result title
"
)(
lambda
:
{
"
lso_result_title
"
:
provisioning_step
.
name
})
>>
_show_results
>>
_clean_state
>>
_clean_state
,
)
def
anonymous_lso_interaction
(
provisioning_step
:
Step
,
validation_step
:
Step
=
_evaluate_results
)
->
Step
List
:
def
anonymous_lso_interaction
(
provisioning_step
:
Step
,
validation_step
:
Step
=
_evaluate_results
)
->
Step
:
"""
Interact with the provisioning proxy :term:`LSO` without any user input.
Similar to the indifferent :term:`LSO` interaction, there also is the anonymous interaction. Output is not ignored
...
...
@@ -205,8 +207,9 @@ def anonymous_lso_interaction(provisioning_step: Step, validation_step: Step = _
:param Step provisioning_step: A workflow step to remotely provision a subscription.
:param Step validation_step: An optional validation step which defaults to a step that evaluates the return code.
"""
return
(
begin
return
step_group
(
name
=
provisioning_step
.
name
,
steps
=
begin
>>
callback_step
(
name
=
provisioning_step
.
name
,
action_step
=
provisioning_step
,
validate_step
=
validation_step
)
>>
_clean_state
>>
_clean_state
,
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment