From a57e34dc44544b1e8dc10cb80471417940c7f30a Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Thu, 1 May 2025 07:50:57 +0100
Subject: [PATCH] Exlude Netbox interactions for Juniper routers

---
 gso/workflows/edge_port/create_edge_port.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gso/workflows/edge_port/create_edge_port.py b/gso/workflows/edge_port/create_edge_port.py
index d221c969f..e25ad1349 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()
-- 
GitLab