haproxysessionmon/config.py
def load_haproxysessionmon_config(s):
    """Loads the HAProxy Session Monitor configuration from the given string, filling in defaults
    where necessary.

    Args:
        s: The string from which to load configuration.

    Returns:
        A Python dictionary containing the configuration.
    """
    try:
        config = yaml.load(s)
    except:
        raise ConfigError("YAML data seems broken", traceback=traceback.format_exc())

    if 'backends' not in config or 'servers' not in config:
        raise ConfigError("Both the \"backends\" and \"servers\" sections are compulsory in configuration")

    if len(config['backends']) < 1 or not isinstance(config['backends'], dict):
        raise ConfigError("At least one backend needs to be configured, or invalid backend configuration syntax")

    if len(config['servers']) < 1 or not isinstance(config['servers'], dict):
        raise ConfigError("At least one HAProxy server needs to be configured, or invalid server configuration syntax")

    config = validate_logging_config(config)
    config = validate_backends_config(config)
    return validate_servers_config(config)
Loads the HAProxy Session Monitor configuration from the given string, filling in defaults
    where necessary.

    Args:
        s: The string from which to load configuration.

    Returns:
        A Python dictionary containing the configuration.
    
Loads the HAProxy Session Monitor configuration from the given string, filling in defaults
where necessary.
Loads the HAProxy Session Monitor configuration from the given string filling in defaults where necessary .
def load_haproxysessionmon_config(s):
    try:
        config = yaml.load(s)
    except:
        raise ConfigError("YAML data seems broken", traceback=traceback.format_exc())
    if 'backends' not in config or 'servers' not in config:
        raise ConfigError("Both the \"backends\" and \"servers\" sections are compulsory in configuration")
    if len(config['backends']) < 1 or not isinstance(config['backends'], dict):
        raise ConfigError("At least one backend needs to be configured, or invalid backend configuration syntax")
    if len(config['servers']) < 1 or not isinstance(config['servers'], dict):
        raise ConfigError("At least one HAProxy server needs to be configured, or invalid server configuration syntax")
    config = validate_logging_config(config)
    config = validate_backends_config(config)
    return validate_servers_config(config)
def load_haproxysessionmon_config ( s ) : try : config = yaml . load ( s ) except : raise ConfigError ( "YAML data seems broken" , traceback = traceback . format_exc ( ) ) if 'backends' not in config or 'servers' not in config : raise ConfigError ( "Both the \"backends\" and \"servers\" sections are compulsory in configuration" ) if len ( config [ 'backends' ] ) < 1 or not isinstance ( config [ 'backends' ] , dict ) : raise ConfigError ( "At least one backend needs to be configured, or invalid backend configuration syntax" ) if len ( config [ 'servers' ] ) < 1 or not isinstance ( config [ 'servers' ] , dict ) : raise ConfigError ( "At least one HAProxy server needs to be configured, or invalid server configuration syntax" ) config = validate_logging_config ( config ) config = validate_backends_config ( config ) return validate_servers_config ( config )
Loads the HAProxy Session Monitor configuration from the given string, filling in defaults
where necessary.
Loads the HAProxy Session Monitor configuration from the given string filling in defaults where necessary .
"""Loads the HAProxy Session Monitor configuration from the given string, filling in defaults
    where necessary.

    Args:
        s: The string from which to load configuration.

    Returns:
        A Python dictionary containing the configuration.
    """
A Python dictionary containing the configuration.
A Python dictionary containing the configuration .
s
The string from which to load configuration.
The string from which to load configuration .