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
评论列表
文章目录