def read_config_file(file_name):
    '''
    Returns a parsed configuration file.

    @param file_name: the path to the configuration file
    @type file_name: str
    '''
    config = ConfigParser.ConfigParser()

    try:
        ret = config.read(file_name)
        if not ret:
            raise ResourceException("The configuration file '%s' doesn't exist"
                                    % file_name)
    except ConfigParser.MissingSectionHeaderError:
        raise ResourceException("Couldn't parse configuration file '%s'" %
                                file_name)

    return config
    
#-----------------------------------------------------------------------------
dataset/ETHPy150Open comodit/synapse-agent/custom_plugins/cloudmanagers-plugin/cm_util.py/read_config_file/original