Commit 3d55a0e5 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp component - FrontEnd:

- Fixed sub-service composition
parent f6eb01b4
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -114,10 +114,12 @@ def convert_explicit_path_hops_to_connections(
        elif prv_res_class[2] is None and res_class[2] is not None:
            # entering domain of a device controller, create underlying connection
            LOGGER.debug('  entering domain of a device controller, create underlying connection')

            if len(connection_stack.queue) > 0:
                prv_service_type = connection_stack.queue[-1].service_type
            else:
                prv_service_type = None

            service_type = get_service_type(res_class[1], prv_service_type)
            connection_entry = ConnectionEntry(service_type=service_type, path_hops=[path_hop])
            connection_stack.put(connection_entry)
@@ -126,6 +128,7 @@ def convert_explicit_path_hops_to_connections(
            LOGGER.debug('  leaving domain of a device controller, terminate underlying connection')
            connection = connection_stack.get()
            connections.append(connection)

            if len(connection_stack.queue) > 0:
                connection_stack.queue[-1].dependencies.append(connection)
                connection_stack.queue[-1].path_hops.append(path_hop)
@@ -139,9 +142,15 @@ def convert_explicit_path_hops_to_connections(
                LOGGER.debug('  switching to different device controller, chain connections')
                connection = connection_stack.get()
                connections.append(connection)

                if len(connection_stack.queue) > 0:
                    connection_stack.queue[-1].dependencies.append(connection)

                if len(connection_stack.queue) > 0:
                    prv_service_type = connection_stack.queue[-1].service_type
                else:
                    prv_service_type = None

                service_type = get_service_type(res_class[1], prv_service_type)
                connection_entry = ConnectionEntry(service_type=service_type, path_hops=[path_hop])
                connection_stack.put(connection_entry)