From 27ec6035456b32f4f01d482a12e6207f99c687ac Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Tue, 6 Feb 2024 14:15:02 +0000
Subject: [PATCH] NBI component:

- Updated service endpoint settings custom resource key to /device/endpoint/settings
- Corrected test files
---
 .../service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py  | 6 ++++--
 src/nbi/tests/data/ietf_l3vpn_req_svc2.json                 | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py
index 3466c8598..80c7b32dd 100644
--- a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py
+++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py
@@ -91,8 +91,10 @@ def update_service_endpoint(
             for (ip_range, ip_prefix_len, lan_tag), next_hop in static_routing.items()
         })
 
-    ENDPOINT_SETTINGS_KEY = '/device[{:s}]/endpoint[{:s}]/vlan[{:d}]/settings'
-    endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid, vlan_tag)
+    #ENDPOINT_SETTINGS_KEY = '/device[{:s}]/endpoint[{:s}]/vlan[{:d}]/settings'
+    #endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid, vlan_tag)
+    ENDPOINT_SETTINGS_KEY = '/device[{:s}]/endpoint[{:s}]/settings'
+    endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid)
     field_updates = {}
     if vlan_tag              is not None: field_updates['vlan_tag'        ] = (vlan_tag,              True)
     if ipv4_address          is not None: field_updates['ip_address'      ] = (ipv4_address,          True)
diff --git a/src/nbi/tests/data/ietf_l3vpn_req_svc2.json b/src/nbi/tests/data/ietf_l3vpn_req_svc2.json
index 4ecf3c2ea..2cc512e59 100644
--- a/src/nbi/tests/data/ietf_l3vpn_req_svc2.json
+++ b/src/nbi/tests/data/ietf_l3vpn_req_svc2.json
@@ -80,7 +80,7 @@
                         "cascaded-lan-prefixes": {
                           "ipv4-lan-prefixes": [
                             {
-                              "lan": "172.1.101.1/24",
+                              "lan": "172.1.201.1/24",
                               "lan-tag": "vlan31",
                               "next-hop": "128.32.33.254"
                             }
@@ -145,7 +145,7 @@
                   "cascaded-lan-prefixes": {
                     "ipv4-lan-prefixes": [
                       {
-                        "lan": "172.1.101.1/24",
+                        "lan": "172.1.201.1/24",
                         "lan-tag": "vlan201",
                         "next-hop": "172.10.33.2"
                       }
-- 
GitLab