Make use of oslo-config-generator

oslo_config provide a utility for generating sample config files,
which provide more detail about opts, like Minimum/Maximum value
and Allowed values.

After this patch, new config options of masakari code should register
with masakari/conf/opts.py.

Change-Id: I8f2f7e87268498ebee7ca164db1c98ef43c279b0
This commit is contained in:
dineshbhor 2016-08-09 15:20:00 +05:30
parent 984ab82a4d
commit 27977c10ee
5 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,4 @@
To generate the sample masakari.conf file, run the following command from the top
level of the masakari directory:
tox -egenconfig

View File

@ -0,0 +1,10 @@
[DEFAULT]
output_file = etc/masakari/masakari.conf.sample
wrap_width = 80
namespace = masakari.conf
namespace = masakari.api
namespace = oslo.log
namespace = oslo.policy
namespace = oslo.db
namespace = oslo.middleware
namespace = keystonemiddleware.auth_token

View File

@ -0,0 +1,7 @@
---
other:
Adopt oslo-config-generator to generate sample config files.
New config options from masakari code should register with
masakari/conf/opts.py. A deprecated option should add a
deprecated group even if it didn't alter its group, otherwise
the deprecated group will use 'DEFAULT' by default.

View File

@ -24,6 +24,12 @@ packages =
masakari
[entry_points]
oslo.config.opts =
masakari.conf = masakari.conf.opts:list_opts
oslo.config.opts.defaults =
masakari.api = masakari.common.config:set_middleware_defaults
console_scripts =
masakari-api = masakari.cmd.api:main
masakari-manage = masakari.cmd.manage:main

View File

@ -16,6 +16,9 @@ commands = python setup.py test --slowest --testr-args='{posargs}'
[testenv:common-constraints]
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/masakari/masakari-config-generator.conf
[testenv:pep8]
commands = flake8 {posargs}
deps = hacking