From c4dd8b89fd1a720a39566abf8d1bf76973b8f015 Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Tue, 25 Aug 2015 17:36:27 +0200 Subject: [PATCH] Enable automatic sample config generation - Added an entry_point for oslo config generator - Added a script to enumerate config options - Added a tox target to invoke config generator Change-Id: Ibc66efd103e790a73ef6389817e099ede65d4f32 --- octavia/opts.py | 31 +++++++++++++++++++++++++++++++ setup.cfg | 2 ++ tox.ini | 9 +++++++++ 3 files changed, 42 insertions(+) create mode 100644 octavia/opts.py diff --git a/octavia/opts.py b/octavia/opts.py new file mode 100644 index 0000000000..44b0b9fddc --- /dev/null +++ b/octavia/opts.py @@ -0,0 +1,31 @@ +# 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 itertools + +import octavia.common.config + + +def list_opts(): + return [ + ('DEFAULT', + itertools.chain(octavia.common.config.core_opts)), + ('networking', octavia.common.config.networking_opts), + ('oslo_messaging', octavia.common.config.oslo_messaging_opts), + ('keystone_authtoken_v3', + octavia.common.config.keystone_authtoken_v3_opts), + ('haproxy_amphora', octavia.common.config.haproxy_amphora_opts), + ('controller_worker', octavia.common.config.controller_worker_opts), + ('task_flow', octavia.common.config.task_flow_opts), + ('certificates', octavia.common.config.certificate_opts), + ('house_keeping', octavia.common.config.house_keeping_opts) + ] diff --git a/setup.cfg b/setup.cfg index d698b4e8fb..4908f5475c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,3 +64,5 @@ octavia.cert_manager = barbican_cert_manager = octavia.certificates.manager.barbican:BarbicanCertManager octavia.plugins = hot_plug_plugin = octavia.controller.worker.controller_worker:ControllerWorker +oslo.config.opts = + octavia = octavia.opts:list_opts diff --git a/tox.ini b/tox.ini index b20cf3a52d..d1619c335c 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,15 @@ commands = flake8 [testenv:docs] commands = python setup.py build_sphinx +[testenv:genconfig] +commands = + oslo-config-generator --output-file etc/octavia/octavia.conf.sample \ + --namespace octavia \ + --namespace oslo.db \ + --namespace oslo.log \ + --namespace oslo.messaging \ + --namespace keystonemiddleware.auth_token + [testenv:specs] commands = find . -type f -name "*.pyc" -delete