X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO-SDN-dpb%2Fosm_rosdn_dpb%2Fwimconn_dpb.py;h=dc717e57b58621a304f3bf2f44246df9c9f52638;hb=refs%2Fchanges%2F82%2F10282%2F5;hp=31072c3645a7a66320991afd57d22e0a8b93ddb8;hpb=36068fd8fe22ca473a7c1ed24202999ba02d0827;p=osm%2FRO.git diff --git a/RO-SDN-dpb/osm_rosdn_dpb/wimconn_dpb.py b/RO-SDN-dpb/osm_rosdn_dpb/wimconn_dpb.py index 31072c36..dc717e57 100755 --- a/RO-SDN-dpb/osm_rosdn_dpb/wimconn_dpb.py +++ b/RO-SDN-dpb/osm_rosdn_dpb/wimconn_dpb.py @@ -30,8 +30,8 @@ import logging import paramiko import requests import struct -import sys -from osm_ro.wim.sdnconn import SdnConnectorBase, SdnConnectorError +# import sys +from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError class DpbSshInterface(): @@ -66,7 +66,7 @@ class DpbSshInterface(): ro is restarted """ self._check_connection() - if data == None: + if data is None: data = {} url_ext_info = url_params.split('/') for i in range(0, len(url_ext_info)): @@ -205,7 +205,7 @@ class DpbRestInterface(): class DpbConnector(SdnConnectorBase): """ Use the DPB to establish multipoint connections """ - __LOGGER_NAME = "openmano.rosdnconn.dpb" + __LOGGER_NAME = "ro.sdn.dpb" __SUPPORTED_SERV_TYPES = ["ELAN (L2)", "ELINE (L2)"] __SUPPORTED_CONNECTION_TYPES = ["REST", "SSH"] __SUPPORTED_SSH_AUTH_TYPES = ["KEY", "PASS"] @@ -321,9 +321,9 @@ class DpbConnector(SdnConnectorBase): try: self.__post(self.__ACTIONS_MAP.get("RELEASE"), "/service/"+service_uuid, get_response=False) - except: + except Exception as e: raise SdnConnectorError( - "Could not delete service id:{} (could be an issue with the DPB)".format(service_uuid), 500) + "Could not delete service id:{} (could be an issue with the DPB): {}".format(service_uuid, e), 500) self.logger.debug( "Deleted connectivity service id:{}".format(service_uuid)) return None @@ -371,6 +371,6 @@ class DpbConnector(SdnConnectorBase): return conn_info def __check_service(self, serv_type, points, kwargs): - if not serv_type in self.__SUPPORTED_SERV_TYPES: + if serv_type not in self.__SUPPORTED_SERV_TYPES: raise SdnConnectorError("Service type no supported", 400) # Future: BW Checks here