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

remove some unused code in provisioning_proxy

parent 8f4fd629
No related branches found
No related tags found
1 merge request!96Make use of new callback step for external provisioning
......@@ -21,8 +21,6 @@ from gso.products.product_types.iptrunk import Iptrunk, IptrunkProvisioning
from gso.products.product_types.router import Router, RouterProvisioning
logger = logging.getLogger(__name__)
DEFAULT_LABEL = "Provisioning proxy is running. Please come back later for the results."
"""The default label displayed when the provisioning proxy is running, in case no custom label is provided."""
class CUDOperation(strEnum):
......@@ -256,7 +254,7 @@ def migrate_ip_trunk(
_send_request("ip_trunk/migrate", parameters, callback_route, CUDOperation.POST)
@step("Evaluate user input for provisioning proxy")
@step("Evaluate provisioning proxy result")
def _evaluate_pp_results(callback_result: dict) -> State:
if callback_result["return_code"] != 0:
raise ProcessFailureError(message="Provisioning proxy failure", details=callback_result)
......@@ -264,14 +262,6 @@ def _evaluate_pp_results(callback_result: dict) -> State:
return {"callback_result": callback_result}
@step("Clean up the state after external provisioning")
def _clean_up_state(state: State) -> State:
for old_key in ["callback_route", "callback_result", "__callback_token"]:
state.pop(old_key, None)
return state
@inputstep("Confirm provisioning proxy results", assignee=Assignee("SYSTEM"))
def _show_pp_results(state: State) -> FormGenerator:
if "callback_result" not in state:
......@@ -289,6 +279,8 @@ def _show_pp_results(state: State) -> FormGenerator:
def pp_interaction(provisioning_step: Step, interaction_name: str) -> StepList:
return begin >> callback_step(
name=interaction_name, action_step=provisioning_step, validate_step=_evaluate_pp_results
) >> _show_pp_results >> _clean_up_state
return (
begin
>> callback_step(name=interaction_name, action_step=provisioning_step, validate_step=_evaluate_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