Skip to content
Snippets Groups Projects
Commit a57e34dc authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Exlude Netbox interactions for Juniper routers

parent 20d59f3b
No related branches found
No related tags found
1 merge request!415Juniper Edge Port modification
Pipeline #93851 passed
...@@ -9,7 +9,7 @@ from orchestrator.forms import FormPage ...@@ -9,7 +9,7 @@ from orchestrator.forms import FormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import SubscriptionLifecycle from orchestrator.types import SubscriptionLifecycle
from orchestrator.utils.errors import ProcessFailureError 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.steps import resync, set_status, store_process_subscription
from orchestrator.workflows.utils import wrap_create_initial_input_form from orchestrator.workflows.utils import wrap_create_initial_input_form
from pydantic import AfterValidator, ConfigDict, model_validator from pydantic import AfterValidator, ConfigDict, model_validator
...@@ -292,16 +292,18 @@ def create_edge_port() -> StepList: ...@@ -292,16 +292,18 @@ def create_edge_port() -> StepList:
* Deploy configuration on the new edge port, first as a dry run * Deploy configuration on the new edge port, first as a dry run
* allocate LAG and LAG members in the Netbox. * allocate LAG and LAG members in the Netbox.
""" """
router_is_nokia = conditional(lambda state: state["subscription"]["edge_port"]["node"]["vendor"] == Vendor.NOKIA)
return ( return (
begin begin
>> create_subscription >> create_subscription
>> store_process_subscription(Target.CREATE) >> store_process_subscription(Target.CREATE)
>> initialize_subscription >> initialize_subscription
>> start_moodi() >> start_moodi()
>> reserve_interfaces_in_netbox >> router_is_nokia(reserve_interfaces_in_netbox)
>> lso_interaction(create_edge_port_dry) >> lso_interaction(create_edge_port_dry)
>> lso_interaction(create_edge_port_real) >> lso_interaction(create_edge_port_real)
>> allocate_interfaces_in_netbox >> router_is_nokia(allocate_interfaces_in_netbox)
>> set_status(SubscriptionLifecycle.ACTIVE) >> set_status(SubscriptionLifecycle.ACTIVE)
>> resync >> resync
>> stop_moodi() >> stop_moodi()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment