util.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:oneview-redfish-toolkit 作者: HewlettPackard 项目源码 文件源码
def load_conf(conf_file):
    """Loads and parses conf file

        Loads and parses the module conf file

        Args:
            conf_file: string with the conf file name

        Returns:
            ConfigParser object with conf_file configs

        Exception:
            OneViewRedfishResourceNotFoundError:
                - if conf file not found
    """

    if not os.path.isfile(conf_file):
        raise errors.OneViewRedfishResourceNotFoundError(conf_file, 'File')

    config = configparser.ConfigParser()
    config.optionxform = str
    try:
        config.read(conf_file)
    except Exception:
        raise

    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号