Make options discoverable
Add the oslo.config entry point so that these options can be discovered by oslo-config-generator. Add a simple tox env to generate a sample config file with the available options. This file may be placed in /etc/nova/conf.d to inject these options into the nova services. Change-Id: I05b564418f3b9334e6a8033b52f165b8bab2eabf Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -33,3 +33,5 @@ pip-log.txt
|
||||
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
|
||||
etc/blazar-nova.conf.sample
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import blazarnova.scheduler.filters.blazar_filter
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [
|
||||
('blazar:physical:host',
|
||||
blazarnova.scheduler.filters.blazar_filter.opts),
|
||||
]
|
||||
@@ -0,0 +1,4 @@
|
||||
[DEFAULT]
|
||||
output_file = etc/blazar-nova.conf.sample
|
||||
wrap_width = 80
|
||||
namespace = blazarnova
|
||||
@@ -30,3 +30,7 @@ Repository = "https://opendev.org/openstack/blazar-nova"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["blazarnova*"]
|
||||
|
||||
[project.entry-points."oslo.config.opts"]
|
||||
"blazarnova" = "blazarnova._opts:list_opts"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[tox]
|
||||
envlist = py3,pep8
|
||||
minversion = 3.18.0
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
@@ -34,6 +33,9 @@ commands = flake8 {posargs}
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:genconfig]
|
||||
commands = oslo-config-generator --config-file=etc/blazar-nova-config-generator.conf
|
||||
|
||||
[flake8]
|
||||
show-source = true
|
||||
builtins = _
|
||||
|
||||
Reference in New Issue
Block a user