1 ##############################################################################
\r
2 # Copyright (c) 2017 ZTE Corporation and others.
\r
4 # All rights reserved. This program and the accompanying materials
\r
5 # are made available under the terms of the Apache License, Version 2.0
\r
6 # which accompanies this distribution, and is available at
\r
7 # http://www.apache.org/licenses/LICENSE-2.0
\r
8 ##############################################################################
\r
11 from oslo_config import cfg
\r
27 ('installer', installer.OPTS),
\r
28 ('monitor', monitor.OPTS),
\r
29 ('inspector', inspector.OPTS),
\r
30 ('consumer', consumer.OPTS),
\r
31 ('DEFAULT', itertools.chain(
\r
41 def prepare_conf(args=None, conf=None, config_files=None):
\r
43 conf = cfg.ConfigOpts()
\r
45 for group, options in list_opts():
\r
46 conf.register_opts(list(options),
\r
47 group=None if group == 'DEFAULT' else group)
\r
49 conf(args, project='doctor', validate_default_values=True,
\r
50 default_config_files=config_files)
\r