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
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
ce6d11e4
Commit
ce6d11e4
authored
11 months ago
by
Karel van Klink
Committed by
Neda Moeini
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
extend the LSO client with an interaction that does not include an input step
parent
aad42eca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!139
Feature/add validation workflows
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/lso_client.py
+25
-1
25 additions, 1 deletion
gso/services/lso_client.py
with
25 additions
and
1 deletion
gso/services/lso_client.py
+
25
−
1
View file @
ce6d11e4
...
...
@@ -134,10 +134,14 @@ def _show_results(state: State) -> FormGenerator:
run_results
:
ReadOnlyField
(
json
.
dumps
(
state
[
"
callback_result
"
],
indent
=
4
),
default_type
=
LongText
)
# type: ignore[valid-type]
yield
ConfirmRunPage
[
state
.
pop
(
key
,
None
)
for
key
in
[
"
run_results
"
,
"
lso_result_title
"
,
"
lso_result_extra_label
"
]]
return
state
@step
(
"
Clean up keys from state
"
)
def
_clean_state
()
->
State
:
return
{
"
__remove_keys
"
:
[
"
run_results
"
,
"
lso_result_title
"
,
"
lso_result_extra_label
"
,
"
callback_result
"
]}
def
lso_interaction
(
provisioning_step
:
Step
)
->
StepList
:
"""
Interact with the provisioning proxy :term:`LSO` using a callback step.
...
...
@@ -159,6 +163,7 @@ def lso_interaction(provisioning_step: Step) -> StepList:
>>
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
)
...
...
@@ -183,4 +188,23 @@ def indifferent_lso_interaction(provisioning_step: Step) -> StepList:
>>
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
)
def
anonymous_lso_interaction
(
provisioning_step
:
Step
,
validation_step
:
Step
=
_ignore_results
)
->
StepList
:
"""
Interact with the provisioning proxy :term:`LSO` without any user input.
Going one step further than the indifferent :term:`LSO` interaction, is the anonymous interaction. Output is ignored
and no input step is created to display the results.
A custom validation step may be given as input. This validation step should look inside the ``callback_result`` key
in the current state.
: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 ignores the results.
"""
return
(
begin
>>
callback_step
(
name
=
provisioning_step
.
name
,
action_step
=
provisioning_step
,
validate_step
=
validation_step
)
>>
_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