Skip to content

configuration

drunc.session_manager.configuration

Configuration for the session manager service.

Classes

SessionManagerConfHandler(data=None, type=ConfTypes.PyObject, oks_key=None, *args, **kwargs)

Bases: ConfHandler

TODO: Change this exception to something more useful.

Source code in drunc/utils/configuration.py
def __init__(
    self,
    data: object = None,
    type: ConfTypes = ConfTypes.PyObject,
    oks_key: OKSKey | None = None,
    *args: object,
    **kwargs: object,
) -> None:
    """Initialize a ConfHandler.

    Args:
        data: The configuration data. Defaults to None.
        type: The configuration type. Defaults to PyObject.
        oks_key: OKS key if using OKS configuration. Defaults to None.
        *args: Additional positional arguments.
        **kwargs: Additional keyword arguments.

    Raises:
        DruncSetupException: If OKS type is used without an OKS key.
    """
    self.class_name = self.__class__.__name__
    self.log = get_logger("utils." + self.class_name)
    self.initial_type = type
    self.initial_data = data
    self.root_id = 0
    self.controller_id = 0
    self.process_id = 0
    self.process_id_infra = 0
    self.session_name = kwargs.get("session_name")

    if type == ConfTypes.OKSFileName and oks_key is None:
        raise DruncSetupException("Need to provide a key for the OKS file")

    self.oks_key = oks_key
    self.validate_and_parse_configuration_location(*args, **kwargs)