Commit acec9682 authored by Pablo Armingol's avatar Pablo Armingol
Browse files

Refactor: Clean up logging in E2EInfoDelete service deletion method

parent 89af5a35
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -220,7 +220,6 @@ class IetfL3VpnDriver(_Driver):
                    results.append((resource_key, e))
        return results


    @metered_subclass_method(METRICS_POOL)
    def DeleteConfig(
        self, resources : List[Tuple[str, Any]]
+0 −9
Original line number Diff line number Diff line
@@ -31,12 +31,8 @@ class E2EInfoDelete(Resource):
        self.service_client = ServiceClient()

    def delete(self, allocationId: str):

        service_type = None
        if 'ipowdm' in allocationId: service_type = 'IPoWDM'

        LOGGER.info("Service type identified as: %s", service_type)

        if service_type == 'IPoWDM':
            LOGGER.info("Deleting IPoWDM service with allocationId: %s", allocationId)
            aux = allocationId
@@ -45,17 +41,12 @@ class E2EInfoDelete(Resource):
            url = f'http://192.168.88.17:9849/api-v0/transponders'
            json_data = json.dumps(data)
            requests.delete(url, data=json_data, headers=headers, timeout=10)

        else:
            LOGGER.error("Unknown service type for allocationId: %s", allocationId)
            return {
                'status': 'Error',
                'message': 'Unknown service type',
            }, 400


        LOGGER.info("Mock DELETE request sent to URL: %s", url)
        LOGGER.info("Allocation ID: %s", allocationId)
        service_id = grpc_service_id(DEFAULT_CONTEXT_NAME, allocationId)
        self.service_client.DeleteService(service_id)