diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index b6f8a7faf89acf25c84326132ff5e965aade61b2..9a9bd27dfa8d651e39ff428ba7cfd61f91624210 100644 --- a/src/service/service/ServiceServiceServicerImpl.py +++ b/src/service/service/ServiceServiceServicerImpl.py @@ -13,7 +13,7 @@ # limitations under the License. import grpc, json, logging, random, uuid -from typing import Optional +from typing import Dict, Optional from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.method_wrappers.ServiceExceptions import ( AlreadyExistsException, InvalidArgumentException, NotFoundException, NotImplementedException, @@ -265,10 +265,18 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): devices = topology_details.devices context_uuid_x = topology_details.topology_id.context_id.context_uuid.uuid topology_uuid_x = topology_details.topology_id.topology_uuid.uuid + + device_names : Dict[str, str] = dict() + for device in devices: + device_uuid = device.device_id.device_uuid.uuid + device_names[device_uuid] = device.name + devs = [] ports = [] for endpoint_id in service.service_endpoint_ids: - devs.append(endpoint_id.device_id.device_uuid.uuid) + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_device_name = device_names[endpoint_device_uuid] + devs.append(endpoint_device_name) ports.append(endpoint_id.endpoint_uuid.uuid) src = devs[0] dst = devs[1] diff --git a/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py b/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py index fac991432028e2c042bfce5dc02dd22d44cac5d0..d98daf280903be397c4315bdb4f87d0086af95ad 100644 --- a/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py +++ b/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py @@ -56,12 +56,15 @@ class Task_ConnectionConfigure(_Task): endpointids_to_set = endpointids_to_raw(connection.path_hops_endpoint_ids) errors = list() - for _, (service_handler, connection_devices) in service_handlers.items(): - _endpointids_to_set = [ - (device_uuid, endpoint_uuid, topology_uuid) - for device_uuid, endpoint_uuid, topology_uuid in endpointids_to_set - if device_uuid in connection_devices - ] + for device_type, (service_handler, connection_devices) in service_handlers.items(): + if device_type == DeviceTypeEnum.TERAFLOWSDN_CONTROLLER: + _endpointids_to_set = endpointids_to_set + else: + _endpointids_to_set = [ + (device_uuid, endpoint_uuid, topology_uuid) + for device_uuid, endpoint_uuid, topology_uuid in endpointids_to_set + if device_uuid in connection_devices + ] results_setendpoint = service_handler.SetEndpoint( _endpointids_to_set, connection_uuid=connection_uuid )