diff --git a/gso/workflows/edge_port/create_edge_port.py b/gso/workflows/edge_port/create_edge_port.py index d221c969fa3065ee7bf78de9585662e67b9b3307..e25ad13491ed04791a9498be8689f030b3f02cbe 100644 --- a/gso/workflows/edge_port/create_edge_port.py +++ b/gso/workflows/edge_port/create_edge_port.py @@ -9,7 +9,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import SubscriptionLifecycle from orchestrator.utils.errors import ProcessFailureError -from orchestrator.workflow import StepList, begin, done +from orchestrator.workflow import StepList, begin, conditional, done from orchestrator.workflows.steps import resync, set_status, store_process_subscription from orchestrator.workflows.utils import wrap_create_initial_input_form from pydantic import AfterValidator, ConfigDict, model_validator @@ -292,16 +292,18 @@ def create_edge_port() -> StepList: * Deploy configuration on the new edge port, first as a dry run * allocate LAG and LAG members in the Netbox. """ + router_is_nokia = conditional(lambda state: state["subscription"]["edge_port"]["node"]["vendor"] == Vendor.NOKIA) + return ( begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription >> start_moodi() - >> reserve_interfaces_in_netbox + >> router_is_nokia(reserve_interfaces_in_netbox) >> lso_interaction(create_edge_port_dry) >> lso_interaction(create_edge_port_real) - >> allocate_interfaces_in_netbox + >> router_is_nokia(allocate_interfaces_in_netbox) >> set_status(SubscriptionLifecycle.ACTIVE) >> resync >> stop_moodi()