From 112b7dd585885b93d6ea01089f6f988fffe8261b Mon Sep 17 00:00:00 2001
From: Simone Spinelli <simone.spinelli@geant.org>
Date: Wed, 31 May 2023 08:58:52 +0000
Subject: [PATCH] Modification of iptrunk

---
 gso/products/product_blocks/iptrunk.py  | 3 +++
 gso/workflows/__init__.py               | 4 ++++
 gso/workflows/iptrunk/create_iptrunk.py | 1 +
 3 files changed, 8 insertions(+)

diff --git a/gso/products/product_blocks/iptrunk.py b/gso/products/product_blocks/iptrunk.py
index 3ac520de..629cf459 100644
--- a/gso/products/product_blocks/iptrunk.py
+++ b/gso/products/product_blocks/iptrunk.py
@@ -21,6 +21,7 @@ class IptrunkBlockInactive(ProductBlockModel,
     iptrunk_type: Optional[IptrunkType] = None
     iptrunk_speed: Optional[str] = None
     iptrunk_minimum_links: Optional[int] = None
+    iptrunk_isis_metric: Optional[int] = None
     iptrunk_ipv4_network: Optional[ipaddress.IPv4Network] = None
     iptrunk_ipv6_network: Optional[ipaddress.IPv6Network] = None
     #
@@ -46,6 +47,7 @@ class IptrunkBlockProvisioning(IptrunkBlockInactive,
     iptrunk_type: Optional[IptrunkType] = None
     iptrunk_speed: Optional[str] = None
     iptrunk_minimum_links: Optional[int] = None
+    iptrunk_isis_metric: Optional[int] = None
     iptrunk_ipv4_network: Optional[ipaddress.IPv4Network] = None
     iptrunk_ipv6_network: Optional[ipaddress.IPv6Network] = None
     #
@@ -71,6 +73,7 @@ class IptrunkBlock(IptrunkBlockProvisioning,
     iptrunk_type: IptrunkType
     iptrunk_speed: str
     iptrunk_minimum_links: int
+    iptrunk_isis_metric: int
     iptrunk_ipv4_network: ipaddress.IPv4Network
     iptrunk_ipv6_network: ipaddress.IPv6Network
     #
diff --git a/gso/workflows/__init__.py b/gso/workflows/__init__.py
index 16f97832..e1dfe7e3 100644
--- a/gso/workflows/__init__.py
+++ b/gso/workflows/__init__.py
@@ -10,4 +10,8 @@ LazyWorkflowInstance("gso.workflows.device.get_facts", "get_facts")
 LazyWorkflowInstance("gso.workflows.iptrunk.create_iptrunk", "create_iptrunk")
 LazyWorkflowInstance("gso.workflows.iptrunk.terminate_iptrunk",
                      "terminate_iptrunk")
+LazyWorkflowInstance("gso.workflows.iptrunk.modify_iptrunk_interface",
+                     "modify_iptrunk_interface")
+LazyWorkflowInstance("gso.workflows.iptrunk.modify_iptrunk_isis_metric",
+                     "modify_iptrunk_isis_metric")
 LazyWorkflowInstance("gso.workflows.site.create_site", "create_site")
diff --git a/gso/workflows/iptrunk/create_iptrunk.py b/gso/workflows/iptrunk/create_iptrunk.py
index 2c76dfe7..b33678d1 100644
--- a/gso/workflows/iptrunk/create_iptrunk.py
+++ b/gso/workflows/iptrunk/create_iptrunk.py
@@ -128,6 +128,7 @@ def initialize_subscription(
     subscription.iptrunk.iptrunk_description = iptrunk_description
     subscription.iptrunk.iptrunk_type = iptrunk_type
     subscription.iptrunk.iptrunk_speed = iptrunk_speed
+    subscription.iptrunk.iptrunk_isis_metric = 9000
     subscription.iptrunk.iptrunk_minimum_links = iptrunk_minimum_links
 
     subscription.iptrunk.iptrunk_sideA_node = Device.from_subscription(
-- 
GitLab