Skip to content
Snippets Groups Projects
Verified Commit 20c2c8c3 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

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!131Move provisioning proxy steps to the new LSO endpoint
......@@ -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
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment