+++ /dev/null
-##############################################################################\r
-# Copyright (c) 2017 ZTE Corporation and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-import itertools\r
-\r
-from oslo_config import cfg\r
-\r
-import alarm\r
-import consumer\r
-import image\r
-import instance\r
-import installer\r
-import network\r
-import inspector\r
-import monitor\r
-import os_clients\r
-import profiler_poc\r
-import user\r
-\r
-\r
-def list_opts():\r
- return [\r
- ('installer', installer.OPTS),\r
- ('monitor', monitor.OPTS),\r
- ('inspector', inspector.OPTS),\r
- ('consumer', consumer.OPTS),\r
- ('DEFAULT', itertools.chain(\r
- os_clients.OPTS,\r
- image.OPTS,\r
- user.OPTS,\r
- network.OPTS,\r
- instance.OPTS,\r
- alarm.OPTS,\r
- profiler_poc.OPTS))\r
- ]\r
-\r
-\r
-def prepare_conf(args=None, conf=None, config_files=None):\r
- if conf is None:\r
- conf = cfg.ConfigOpts()\r
-\r
- for group, options in list_opts():\r
- conf.register_opts(list(options),\r
- group=None if group == 'DEFAULT' else group)\r
-\r
- conf(args, project='doctor', validate_default_values=True,\r
- default_config_files=config_files)\r
-\r
- return conf\r