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
20c2c8c3
Verified
Commit
20c2c8c3
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Add an indifferent pp interaction, that won't make the workflow fail despite the outcome
parent
4caf2766
No related branches found
No related tags found
1 merge request
!131
Move provisioning proxy steps to the new LSO endpoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/provisioning_proxy.py
+32
-0
32 additions, 0 deletions
gso/services/provisioning_proxy.py
with
32 additions
and
0 deletions
gso/services/provisioning_proxy.py
+
32
−
0
View file @
20c2c8c3
...
...
@@ -287,6 +287,11 @@ def _evaluate_pp_results(callback_result: dict) -> State:
return
{
"
callback_result
"
:
callback_result
}
@step
(
"
Ignore provisioning proxy result
"
)
def
_ignore_pp_results
(
callback_result
:
dict
)
->
State
:
return
{
"
callback_result
"
:
callback_result
}
@inputstep
(
"
Confirm provisioning proxy results
"
,
assignee
=
Assignee
(
"
SYSTEM
"
))
def
_show_pp_results
(
state
:
State
)
->
FormGenerator
:
if
"
callback_result
"
not
in
state
:
...
...
@@ -324,3 +329,30 @@ def pp_interaction(provisioning_step: Step) -> StepList:
)
>>
_show_pp_results
)
def
indifferent_pp_interaction
(
provisioning_step
:
Step
)
->
StepList
:
"""
Interact with the provisioning proxy :term:`LSO` using a callback step.
This interaction is identical from the one described in ``pp_interaction()``, with one functional difference.
Whereas the ``pp_interaction()`` will make the workflow step fail on unsuccessful interaction, this step will not.
It is therefore indifferent about the outcome of the Ansible playbook that is executed.
.. warning::
Using this interaction requires the operator to carefully evaluate the outcome of a playbook themselves. If a
playbook fails, this will not cause the workflow to fail.
: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:`StepList`
"""
return
(
begin
>>
callback_step
(
name
=
provisioning_step
.
name
,
action_step
=
provisioning_step
,
validate_step
=
_ignore_pp_results
,
)
>>
_show_pp_results
)
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