Skip to content
Snippets Groups Projects
Verified Commit 00bbcd7d 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 b82eb638
No related branches found
No related tags found
No related merge requests found
...@@ -287,6 +287,11 @@ def _evaluate_pp_results(callback_result: dict) -> State: ...@@ -287,6 +287,11 @@ def _evaluate_pp_results(callback_result: dict) -> State:
return {"callback_result": callback_result} 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")) @inputstep("Confirm provisioning proxy results", assignee=Assignee("SYSTEM"))
def _show_pp_results(state: State) -> FormGenerator: def _show_pp_results(state: State) -> FormGenerator:
if "callback_result" not in state: if "callback_result" not in state:
...@@ -324,3 +329,30 @@ def pp_interaction(provisioning_step: Step) -> StepList: ...@@ -324,3 +329,30 @@ def pp_interaction(provisioning_step: Step) -> StepList:
) )
>> _show_pp_results >> _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.
Please register or to comment