

def _get_raw_config(self):
    raw_config = {
        
    }
    try:
        config = ConfigParser.ConfigParser()
        config_path = os.path.dirname(get_config_path())
        if os.path.exists(os.path.join(config_path, 'plugins.d')):
            config_path = os.path.join(config_path, 'plugins.d')
        else:
            config_path = os.path.join(config_path, 'plugins.cfg')
        if (not os.access(config_path, os.R_OK)):
            self.logger.error(('Unable to read the config file at ' + config_path))
            self.logger.error('Using no config...')
            return raw_config
        if os.path.isdir(config_path):
            for config_file in glob(os.path.join(config_path, '*.cfg')):
                config.read(config_file)
        else:
            config.read(config_path)
        for section in config.sections():
            raw_config[section] = {
                
            }
            for option in config.options(section):
                raw_config[section][option] = config.get(section, option)
    except ConfigParser.ParsingError:
        self.logger.error('v1 Plugins config file not found or incorrectly formatted.')
    return raw_config

dataset/ETHPy150Open serverdensity/sd-agent/checks/server_density/plugins.py Plugins._get_raw_config/original