X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO-SDN-ietfl2vpn%2Fosm_rosdn_ietfl2vpn%2Fwimconn_ietfl2vpn.py;h=4cfeb12c91a3d74f178d3a22e4e2c4cc75c33e8e;hb=refs%2Fchanges%2F01%2F12701%2F3;hp=1a581bc6aecf37cb343b130710c5ee88482139af;hpb=dfad9cde8fb089f926f66198671295610321930f;p=osm%2FRO.git diff --git a/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py b/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py index 1a581bc6..4cfeb12c 100644 --- a/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py +++ b/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py @@ -30,12 +30,12 @@ This SDN/WIM connector implements the standard IETF RFC 8466 "A YANG Data It receives the endpoints and the necessary details to request the Layer 2 service. """ -import requests -import uuid + import logging -from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError +import uuid -"""Check layer where we move it""" +from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError +import requests class WimconnectorIETFL2VPN(SdnConnectorBase): @@ -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 = []