From: gifrerenom Date: Mon, 7 Mar 2022 18:00:01 +0000 (+0000) Subject: Fix bug 2157 to resolve issues with IETF L2VPN WIM connector X-Git-Tag: release-v13.0-start~8 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=commitdiff_plain;h=3ba0714fb3cf8edcd2c9e7ca95587f4c7973d292 Fix bug 2157 to resolve issues with IETF L2VPN WIM connector Change-Id: If03acb8469f36bbca51a936bfb0808ec0124468f Signed-off-by: gifrerenom --- diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py index d2b00d65..6e9f1043 100644 --- a/NG-RO/osm_ng_ro/ns_thread.py +++ b/NG-RO/osm_ng_ro/ns_thread.py @@ -1841,7 +1841,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") diff --git a/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py b/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py index ada0d72f..4cfeb12c 100644 --- a/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py +++ b/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py @@ -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 index 00000000..37200510 --- /dev/null +++ b/releasenotes/notes/fix_bug_1902-079eb93c44b92b5a.yaml @@ -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.