__init__.py 文件源码

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

项目:fuel-ccp 作者: openstack 项目源码 文件源码
def get_config_schema():
    schema = {
        '$schema': 'http://json-schema.org/draft-04/schema#',
        'additionalProperties': False,
        'properties': {
            'debug': {'type': 'boolean'},
            'verbose_level': {'type': 'integer'},
            'log_file': {'anyOf': [{'type': 'null'}, {'type': 'string'}]},
            'default_log_levels': {'type': 'array',
                                   'items': {'type': 'string'}}
        },
    }
    for module in CONFIG_MODULES:
        schema['properties'].update(module.SCHEMA)
    # Don't validate all options used to be added from oslo.log and oslo.config
    ignore_opts = ['debug', 'verbose', 'log_file']
    for name in ignore_opts:
        schema['properties'][name] = {}
    # Also for now don't validate sections that used to be in deploy config
    for name in ['configs', 'secret_configs', 'nodes', 'roles', 'versions']:
        schema['properties'][name] = {'type': 'object'}
    return schema
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号