From: gifrerenom Date: Mon, 7 Mar 2022 18:00:01 +0000 (+0000) Subject: Fix bug 1902 to resolve issues with IETF L2VPN WIM connector X-Git-Tag: v10.1.1-rc1~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=603a77b8455560b3fa836dd8c18e99ba034474c8;p=osm%2FRO.git Fix bug 1902 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 24464521..03070712 100644 --- a/NG-RO/osm_ng_ro/ns_thread.py +++ b/NG-RO/osm_ng_ro/ns_thread.py @@ -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") 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.