init.py 文件源码

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

项目:valet 作者: openstack 项目源码 文件源码
def prepare(CONF):
    """Prepare config options."""
    global _initialized
    try:
        if _initialized is False:
            logging.register_options(CONF)
            _initialized = True

        # Adding config file
            possible_topdir = os.path.normpath(
                os.path.join(os.path.abspath(__file__), os.pardir,
                             os.pardir, os.pardir))
            conf_file = os.path.join(possible_topdir, 'etc', DOMAIN + '.cfg')
            CONF([], project=DOMAIN, default_config_files=[conf_file] or None,
                 validate_default_values=True)

            logging.setup(CONF, DOMAIN)

    except Exception as ex:
        LOG.error("Preparation failed! %s" % ex)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号