Fix bug 1902 to resolve issues with IETF L2VPN WIM connector 32/11732/5
authorgifrerenom <lluis.gifre@cttc.es>
Mon, 7 Mar 2022 18:00:01 +0000 (18:00 +0000)
committergifrerenom <lluis.gifre@cttc.es>
Mon, 14 Mar 2022 19:59:44 +0000 (19:59 +0000)
Change-Id: If03acb8469f36bbca51a936bfb0808ec0124468f
Signed-off-by: gifrerenom <lluis.gifre@cttc.es>
NG-RO/osm_ng_ro/ns_thread.py
RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py
releasenotes/notes/fix_bug_1902-079eb93c44b92b5a.yaml [new file with mode: 0644]

index 2446452..0307071 100644 (file)
@@ -1462,7 +1462,10 @@ class NsWorker(threading.Thread):
                 wim = deepcopy(vim)
                 wim_config = wim.pop("config", {}) or {}
                 wim["uuid"] = wim["_id"]
-                wim["wim_url"] = wim["url"]
+                if "url" in wim and "wim_url" not in wim:
+                    wim["wim_url"] = wim["url"]
+                elif "url" not in wim and "wim_url" in wim:
+                    wim["url"] = wim["wim_url"]
 
                 if wim.get("dpid"):
                     wim_config["dpid"] = wim.pop("dpid")
index ada0d72..4cfeb12 100644 (file)
@@ -48,12 +48,16 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
         """
         self.logger = logging.getLogger("ro.sdn.ietfl2vpn")
         super().__init__(wim, wim_account, config, logger)
+        if len(self.service_endpoint_mapping) == 0 and self.config.get(
+            "wim_port_mapping"
+        ):
+            self.service_endpoint_mapping = self.config.get("wim_port_mapping", [])
         self.headers = {"Content-Type": "application/json"}
         self.mappings = {
             m["service_endpoint_id"]: m for m in self.service_endpoint_mapping
         }
         self.user = wim_account.get("user")
-        self.passwd = wim_account.get("passwordd")
+        self.passwd = wim_account.get("password")
 
         if self.user and self.passwd is not None:
             self.auth = (self.user, self.passwd)
@@ -176,7 +180,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
             uuid_l2vpn = str(uuid.uuid4())
             vpn_service = {}
             vpn_service["vpn-id"] = uuid_l2vpn
-            vpn_service["vpn-scv-type"] = "vpws"
+            vpn_service["vpn-svc-type"] = "vpws"
             vpn_service["svc-topo"] = "any-to-any"
             vpn_service["customer-name"] = "osm"
             vpn_service_list = []
diff --git a/releasenotes/notes/fix_bug_1902-079eb93c44b92b5a.yaml b/releasenotes/notes/fix_bug_1902-079eb93c44b92b5a.yaml
new file mode 100644 (file)
index 0000000..3720051
--- /dev/null
@@ -0,0 +1,20 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+  - |
+    Fixing bug 1902 - to resolve issues with IETF L2VPN WIM connector.