Loading src/tests/l2_vpn_gnmi_oc/tests/WimconnectorIETFL2VPN.py +23 −25 Original line number Diff line number Diff line Loading @@ -69,14 +69,14 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): self.wim["wim_url"] ) #try: # response = requests.get(endpoint, auth=self.auth) # http_code = response.status_code #except requests.exceptions.RequestException as e: # raise SdnConnectorError(e.response, http_code=503) try: response = requests.get(endpoint, auth=self.auth) http_code = response.status_code except requests.exceptions.RequestException as e: raise SdnConnectorError(e.response, http_code=503) #if http_code != 200: # raise SdnConnectorError("Failed while authenticating", http_code=http_code) if http_code != 200: raise SdnConnectorError("Failed while authenticating", http_code=http_code) self.logger.info("Credentials checked") Loading Loading @@ -208,21 +208,20 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): auth=self.auth, ) except requests.exceptions.ConnectionError: #raise SdnConnectorError( # "Request to create service Timeout", http_code=408 #) pass #if response_service_creation.status_code == 409: # raise SdnConnectorError( # "Service already exists", # http_code=response_service_creation.status_code, # ) #elif response_service_creation.status_code != requests.codes.created: # raise SdnConnectorError( # "Request to create service not accepted", # http_code=response_service_creation.status_code, # ) raise SdnConnectorError( "Request to create service Timeout", http_code=408 ) if response_service_creation.status_code == 409: raise SdnConnectorError( "Service already exists", http_code=response_service_creation.status_code, ) elif response_service_creation.status_code != requests.codes.created: raise SdnConnectorError( "Request to create service not accepted", http_code=response_service_creation.status_code, ) self.logger.info('connection_points = {:s}'.format(str(connection_points))) Loading Loading @@ -378,10 +377,9 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): http_code=response_endpoint_site_network_access_creation.status_code, ) except requests.exceptions.ConnectionError: #self.delete_connectivity_service(vpn_service["vpn-id"]) self.delete_connectivity_service(vpn_service["vpn-id"]) #raise SdnConnectorError("Request Timeout", http_code=408) pass raise SdnConnectorError("Request Timeout", http_code=408) return uuid_l2vpn, conn_info Loading Loading
src/tests/l2_vpn_gnmi_oc/tests/WimconnectorIETFL2VPN.py +23 −25 Original line number Diff line number Diff line Loading @@ -69,14 +69,14 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): self.wim["wim_url"] ) #try: # response = requests.get(endpoint, auth=self.auth) # http_code = response.status_code #except requests.exceptions.RequestException as e: # raise SdnConnectorError(e.response, http_code=503) try: response = requests.get(endpoint, auth=self.auth) http_code = response.status_code except requests.exceptions.RequestException as e: raise SdnConnectorError(e.response, http_code=503) #if http_code != 200: # raise SdnConnectorError("Failed while authenticating", http_code=http_code) if http_code != 200: raise SdnConnectorError("Failed while authenticating", http_code=http_code) self.logger.info("Credentials checked") Loading Loading @@ -208,21 +208,20 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): auth=self.auth, ) except requests.exceptions.ConnectionError: #raise SdnConnectorError( # "Request to create service Timeout", http_code=408 #) pass #if response_service_creation.status_code == 409: # raise SdnConnectorError( # "Service already exists", # http_code=response_service_creation.status_code, # ) #elif response_service_creation.status_code != requests.codes.created: # raise SdnConnectorError( # "Request to create service not accepted", # http_code=response_service_creation.status_code, # ) raise SdnConnectorError( "Request to create service Timeout", http_code=408 ) if response_service_creation.status_code == 409: raise SdnConnectorError( "Service already exists", http_code=response_service_creation.status_code, ) elif response_service_creation.status_code != requests.codes.created: raise SdnConnectorError( "Request to create service not accepted", http_code=response_service_creation.status_code, ) self.logger.info('connection_points = {:s}'.format(str(connection_points))) Loading Loading @@ -378,10 +377,9 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): http_code=response_endpoint_site_network_access_creation.status_code, ) except requests.exceptions.ConnectionError: #self.delete_connectivity_service(vpn_service["vpn-id"]) self.delete_connectivity_service(vpn_service["vpn-id"]) #raise SdnConnectorError("Request Timeout", http_code=408) pass raise SdnConnectorError("Request Timeout", http_code=408) return uuid_l2vpn, conn_info Loading