(config_file=None)
return sigma_config
Get a sigma.configuration.SigmaConfiguration object.

    Args:
        config_file: Optional path to a config file
    Returns:
        A sigma.configuration.SigmaConfiguration object
    Raises:
        ValueError: If SIGMA_CONFIG is not found in the config file.
            or the Sigma config file is not readabale.
        SigmaConfigParseError: If config file could not be parsed.
Get a sigma.configuration.SigmaConfiguration object.
Get a sigma . configuration . SigmaConfiguration object .
def get_sigma_config_file(config_file=None):
    """Get a sigma.configuration.SigmaConfiguration object.

    Args:
        config_file: Optional path to a config file
    Returns:
        A sigma.configuration.SigmaConfiguration object
    Raises:
        ValueError: If SIGMA_CONFIG is not found in the config file.
            or the Sigma config file is not readabale.
        SigmaConfigParseError: If config file could not be parsed.
    """
    if config_file:
        config_file_path = config_file
    else:
        config_file_path = current_app.config.get(
            'SIGMA_CONFIG', './data/sigma_config.yaml')

    if not config_file_path:
        raise ValueError('No config_file_path set via param or config file')

    if not os.path.isfile(config_file_path):
        raise ValueError(
            'Unable to open file: [{0:s}], it does not exist.'.format(
                config_file_path))

    if not os.access(config_file_path, os.R_OK):
        raise ValueError(
            'Unable to open file: [{0:s}], cannot open it for '
            'read, please check permissions.'.format(config_file_path))

    with open(config_file_path, 'r') as config_file_read:
        sigma_config_file = config_file_read.read()

    try:
        sigma_config = sigma_configuration.SigmaConfiguration(
            sigma_config_file)
    except SigmaConfigParseError:
        logger.error('Parsing error with {0:s}'.format(sigma_config_file))
        raise

    return sigma_config
def get_sigma_config_file ( config_file = None ) : if config_file : config_file_path = config_file else : config_file_path = current_app . config . get ( 'SIGMA_CONFIG' , './data/sigma_config.yaml' ) if not config_file_path : raise ValueError ( 'No config_file_path set via param or config file' ) if not os . path . isfile ( config_file_path ) : raise ValueError ( 'Unable to open file: [{0:s}], it does not exist.' . format ( config_file_path ) ) if not os . access ( config_file_path , os . R_OK ) : raise ValueError ( 'Unable to open file: [{0:s}], cannot open it for ' 'read, please check permissions.' . format ( config_file_path ) ) with open ( config_file_path , 'r' ) as config_file_read : sigma_config_file = config_file_read . read ( ) try : sigma_config = sigma_configuration . SigmaConfiguration ( sigma_config_file ) except SigmaConfigParseError : logger . error ( 'Parsing error with {0:s}' . format ( sigma_config_file ) ) raise return sigma_config