pypdns.py 文件源码

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

项目:pypdns 作者: fousti 项目源码 文件源码
def parse_config(cfg, ext_config={}):
    config = {}
    try:
        options = cfg.options('pypdns')
    except ConfigParser.NoSectionError:
        log.debug('No config files provided and default not present')
        options = []

    for option in options:
        config[option] = cfg.get('pypdns', option)

    for ckey, cvalue in iteritems(DEFAULT_CONFIG):
        if ckey not in config:
            config[ckey] = cvalue

    for k in ('endpoint', 'apikey'):
        if ext_config.get(k) is not None:
            config[k] = ext_config[k]

    assert (config.get('endpoint') is not None and
            config.get('apikey') is not None), 'Configuration not found'

    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号