Commit 05051e46 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service component - optical logic:

- Correct device name mapping issue
parent de22bc5d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -269,15 +269,12 @@ class ServiceServiceServicerImpl(ServiceServiceServicer):
            device_names : Dict[str, str] = dict()
            for device in devices:
                device_uuid = device.device_id.device_uuid.uuid
                device_names[device_uuid] = device.name

            LOGGER.warning('device_names={:s}'.format(str(device_names)))
            LOGGER.warning('service={:s}'.format(grpc_message_to_json_string(service)))
                device_names[device_uuid] = device.name # ID => name
                device_names[device.name] = device.name # name => name (that way, if not present, crash)

            devs = []
            ports = []
            for endpoint_id in service.service_endpoint_ids:
                LOGGER.warning('endpoint_id={:s}'.format(grpc_message_to_json_string(endpoint_id)))
                endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid
                endpoint_device_name = device_names[endpoint_device_uuid]
                devs.append(endpoint_device_name)