Commit a377af3d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service component:

- Added translation of UUID to name for optical connection endpoint devices
- Extended Task_ConnectionConfigure to delegate on remote TeraFlowSDN controllers when needed
parent 761810ec
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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]
+9 −6
Original line number Diff line number Diff line
@@ -56,7 +56,10 @@ 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():
        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