Commit 7ccdba0a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp component:

- Added logic to extrapolate underlyign connections for remote domains
parent a8c7843a
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ import logging, queue, uuid
from typing import Dict, List, Optional, Tuple
from common.DeviceTypes import DeviceTypeEnum
from common.proto.context_pb2 import Device, ServiceTypeEnum
from .ResourceGroups import IGNORED_DEVICE_TYPES, get_resource_classification
from .ResourceGroups import IGNORED_DEVICE_TYPES, REMOTEDOMAIN_DEVICE_TYPES, get_resource_classification
from .ServiceTypes import get_service_type

LOGGER = logging.getLogger(__name__)
@@ -81,7 +81,21 @@ def convert_explicit_path_hops_to_connections(
            LOGGER.debug('  ignored')
            continue

        if prv_res_class[0] is None:
        if res_class[1] in REMOTEDOMAIN_DEVICE_TYPES:
            LOGGER.debug('  create and terminate underlying connection')

            # create underlying connection
            connection_uuid = str(uuid.uuid4())
            prv_service_type = connection_stack.queue[-1][1]
            service_type = get_service_type(res_class[1], prv_service_type)
            connection_stack.put((connection_uuid, service_type, [path_hop], []))

            # underlying connection ended
            connection = connection_stack.get()
            connections.append(connection)
            connection_stack.queue[-1][3].append(connection[0])
            #connection_stack.queue[-1][2].append(path_hop)
        elif prv_res_class[0] is None:
            # path ingress
            LOGGER.debug('  path ingress')
            connection_stack.put((main_service_uuid, main_service_type, [path_hop], []))
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ DEVICE_TYPE_TO_DEEPNESS = {
}

IGNORED_DEVICE_TYPES = {DeviceTypeEnum.EMULATED_OPTICAL_SPLITTER}
REMOTEDOMAIN_DEVICE_TYPES = {DeviceTypeEnum.NETWORK}

def get_device_controller_uuid(
    device : Device