diff --git a/src/drunc/controller/children_interface/child_node.py b/src/drunc/controller/children_interface/child_node.py index 9d91bdea..865b6ed1 100644 --- a/src/drunc/controller/children_interface/child_node.py +++ b/src/drunc/controller/children_interface/child_node.py @@ -1,6 +1,7 @@ import abc from drunc.exceptions import DruncSetupException from drunc.utils.utils import ControlType, get_control_type_and_uri_from_connectivity_service, get_control_type_and_uri_from_cli +import logging from drunc.utils.grpc_utils import pack_to_any from druncschema.token_pb2 import Token from druncschema.request_response_pb2 import Response, ResponseFlag, Description @@ -61,7 +62,7 @@ def describe(self, token:Token) -> Response: name = descriptionName, endpoint = self.get_endpoint(), info = get_detector_name(self.configuration), - session = os.getenv("DUNEDAQ_SESSION"), + session = os.getenv("DUNEDAQ_SESSION"), commands = None, broadcast = None, ) @@ -78,15 +79,15 @@ def describe(self, token:Token) -> Response: @staticmethod def get_child(name:str, cli, configuration, init_token=None, connectivity_service=None, **kwargs): + log = logging.getLogger("ChildNode.get_child") from drunc.utils.configuration import ConfTypes + log.info(f"Setting up child '{name}'") ctype = ControlType.Unknown uri = None if connectivity_service: ctype, uri = get_control_type_and_uri_from_connectivity_service(connectivity_service, name, timeout=60) - import logging - log = logging.getLogger("ChildNode.get_child") if ctype == ControlType.Unknown: ctype, uri = get_control_type_and_uri_from_cli(cli) diff --git a/src/drunc/controller/configuration.py b/src/drunc/controller/configuration.py index f90e6704..0b0b12f7 100644 --- a/src/drunc/controller/configuration.py +++ b/src/drunc/controller/configuration.py @@ -22,8 +22,9 @@ def find_segment(segment, id): return segment for child_segment in segment.segments: - if ControllerConfHandler.find_segment(child_segment, id) is not None: - return child_segment + segment = ControllerConfHandler.find_segment(child_segment, id) + if segment is not None: + return segment return None diff --git a/src/drunc/controller/controller.py b/src/drunc/controller/controller.py index 2d9edda0..184dfcb3 100644 --- a/src/drunc/controller/controller.py +++ b/src/drunc/controller/controller.py @@ -81,7 +81,7 @@ def __init__(self, configuration, name:str, session:str, token:Token): from logging import getLogger self.logger = getLogger('Controller') - + self.logger.info(f'Initialising controller \'{name}\' with session \'{session}\'') self.configuration = configuration from drunc.broadcast.server.configuration import BroadcastSenderConfHandler