From e81342ae10c51756c94f7a99c5ecbe4fa81f48dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20J=C3=B3zefczyk?= Date: Mon, 16 Mar 2020 11:32:50 +0000 Subject: [PATCH] Add configuration page to docs This page was missing. Added also tox env to generate config. Change-Id: I8d8ed95ec603ea143a24d28dc92fa55600e0274e --- doc/source/configuration/config.rst | 14 ++++++++++++++ doc/source/configuration/index.rst | 10 ++++++++++ doc/source/index.rst | 1 + etc/octavia/.placeholder | 0 etc/octavia/conf.d/.placeholder | 0 etc/oslo-config-generator/ovn.conf | 5 +++++ setup.cfg | 3 +++ tools/generate_config_file_samples.sh | 26 ++++++++++++++++++++++++++ tox.ini | 5 +++++ 9 files changed, 64 insertions(+) create mode 100644 doc/source/configuration/config.rst create mode 100644 doc/source/configuration/index.rst create mode 100644 etc/octavia/.placeholder create mode 100644 etc/octavia/conf.d/.placeholder create mode 100644 etc/oslo-config-generator/ovn.conf create mode 100755 tools/generate_config_file_samples.sh diff --git a/doc/source/configuration/config.rst b/doc/source/configuration/config.rst new file mode 100644 index 00000000..99b6662c --- /dev/null +++ b/doc/source/configuration/config.rst @@ -0,0 +1,14 @@ +======================= +Configuration Reference +======================= + +This section provides a list of all configuration options for OVN Octavia +provider. These are auto-generated from OVN Octavia provider code when +this documentation is built. + +Configuration filenames used below are filenames usually used, but there +is no restriction on configuration filename and you can use +arbitrary file names. + +.. show-options:: + :config-file: etc/oslo-config-generator/ovn.conf diff --git a/doc/source/configuration/index.rst b/doc/source/configuration/index.rst new file mode 100644 index 00000000..138fa21d --- /dev/null +++ b/doc/source/configuration/index.rst @@ -0,0 +1,10 @@ +.. _configuring: + +=================== +Configuration Guide +=================== + +.. toctree:: + :maxdepth: 1 + + config diff --git a/doc/source/index.rst b/doc/source/index.rst index 2e2cefd0..0c05e24c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -28,6 +28,7 @@ Contents admin/index contributor/index + configuration/index Search ------ diff --git a/etc/octavia/.placeholder b/etc/octavia/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/etc/octavia/conf.d/.placeholder b/etc/octavia/conf.d/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/etc/oslo-config-generator/ovn.conf b/etc/oslo-config-generator/ovn.conf new file mode 100644 index 00000000..edea39e7 --- /dev/null +++ b/etc/oslo-config-generator/ovn.conf @@ -0,0 +1,5 @@ +[DEFAULT] +output_file = etc/octavia/conf.d/ovn.conf.sample +wrap_width = 79 + +namespace = octavia.api.drivers.ovn diff --git a/setup.cfg b/setup.cfg index 1571fea1..f2604c5e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,3 +30,6 @@ setup-hooks = [entry_points] octavia.api.drivers = ovn = ovn_octavia_provider.driver:OvnProviderDriver + +oslo.config.opts = + octavia.api.drivers.ovn = ovn_octavia_provider.common.config:list_opts diff --git a/tools/generate_config_file_samples.sh b/tools/generate_config_file_samples.sh new file mode 100755 index 00000000..533b31c7 --- /dev/null +++ b/tools/generate_config_file_samples.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# 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. + +set -e + +GEN_CMD=oslo-config-generator + +if ! type "$GEN_CMD" > /dev/null; then + echo "ERROR: $GEN_CMD not installed on the system." + exit 1 +fi + +for file in `ls etc/oslo-config-generator/*`; do + $GEN_CMD --config-file=$file +done diff --git a/tox.ini b/tox.ini index fb6cd669..10bd1a61 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,7 @@ commands = flake8 {toxinidir}/tools/check_unit_test_structure.sh {toxinidir}/tools/coding-checks.sh --pylint '{posargs}' {[testenv:bandit]commands} + {[testenv:genconfig]commands} [testenv:venv] commands = {posargs} @@ -109,6 +110,10 @@ show-source = True exclude=./.*,dist,doc,*egg*,build,releasenotes import-order-style = pep8 +[testenv:genconfig] +envdir = {toxworkdir}/shared +commands = {toxinidir}/tools/generate_config_file_samples.sh + [hacking] import_exceptions = ovn_octavia_provider.i18n local-check-factory = neutron_lib.hacking.checks.factory