Commit 9e8ceb44 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service component - Optical TFS Service Handler:

- Corrected DeleteEndpoint method()
parent 606fb96c
Loading
Loading
Loading
Loading
+5 −15
Original line number Diff line number Diff line
@@ -106,19 +106,16 @@ class OpticalTfsServiceHandler(_ServiceHandler):
        if len(endpoints) < 2: return []

        service_uuid = self.__service.service_id.service_uuid.uuid
        settings = self.__settings_handler.get('/settings')
        json_settings : Dict = {} if settings is None else settings.value
        flow_id = json_settings['flow_id']
        bitrate, bidir, ob_width = self._get_constraints()
        service_name = self.__service.name

        results = []
        try:
            src_device_uuid, src_endpoint_uuid = get_device_endpoint_uuids(endpoints[0])
            src_device_uuid, _ = get_device_endpoint_uuids(endpoints[0])
            src_device = self.__task_executor.get_device(DeviceId(**json_device_id(src_device_uuid)))
            src_controller = self.__task_executor.get_device_controller(src_device)
            if src_controller is None: src_controller = src_device

            dst_device_uuid, dst_endpoint_uuid = get_device_endpoint_uuids(endpoints[1])
            dst_device_uuid, _ = get_device_endpoint_uuids(endpoints[-1])
            dst_device = self.__task_executor.get_device(DeviceId(**json_device_id(dst_device_uuid)))
            dst_controller = self.__task_executor.get_device_controller(dst_device)
            if dst_controller is None: dst_controller = dst_device
@@ -126,15 +123,8 @@ class OpticalTfsServiceHandler(_ServiceHandler):
            controller = src_controller

            json_config_rule = json_config_rule_delete('/services/service[{:s}]'.format(service_uuid), {
                'flow_id'          : flow_id,
                'service_uuid': service_uuid,
                'src_device_uuid'  : src_device_uuid,
                'src_endpoint_uuid': src_endpoint_uuid,
                'dst_device_uuid'  : dst_device_uuid,
                'dst_endpoint_uuid': dst_endpoint_uuid,
                'bitrate'          : bitrate,
                'bidir'            : bidir,
                'ob_width'         : ob_width,
                'service_name': service_name,
            })

            del controller.device_config.config_rules[:]