This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).
Change-Id: I733bb8cb495f56edf512656ccb47867b8214ac28
When a documentation build fails, it can be difficult to determine
why. Providing RST output for the config generator will allow a
contributor to look at the documentation being parsed by Sphinx to
find issues.
Change-Id: I4f9babc243d4a307bedd84dd4ff60f82cd16f8db
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
When the RST parser encounters a literal value with spaces before the
closing backticks, it misinterprets that as an unclosed literal
expression. Fix the logic that used to add quotes around such lines,
both to make the values more visible to readers of the documentation
and to fix the parsing issue.
Change-Id: I1bfd675d6611c59f4b3cc4816d48dbb199340bec
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
In I6e28c25f04273f7def486fadd541babc8cf423cb we tried to add the
ability to look for a deprecated option using its old name but finding
the value associated with the new name, similar to how the lookup
works when reading values from config files. That patch did not
account for group values that are objects not strings. This fixes the
oversight.
Change-Id: I98e18e88626164b365466ff476125d41cc8641ec
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
The sample config generator and sphinx integration are breaking when
option defaults are not strings. This shows up in cinder, so this bug
is preventing cinder from adopting the sphinx integration for showing
configuration options.
Fix the rendering in the generator, and in the type class for list
options.
Change-Id: Ib8a248b6dc695b6afe4f1e760af836ac664fa137
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
In python 3.6, escape sequences that are not
recognized in string literals issue DeprecationWarnings.
Convert these to raw strings.
Change-Id: Ibfefa7467c29bcb30c65f3c5d296daa8cc1ff7be
The plugin is *very* noisy for a project with as many configuration
options as nova. Most of the output is debug info at best, so mark it up
accordingly.
Change-Id: Ic806317852475258a2dc2c563af098788d4e9ccc
Related-Bug: #1702453
The 'oslo.config:group' directive was parsing content to extract the
name of the group. However, this had the side effect of picking up any
body text, resulting is super long titles. Correct this by adding a
single required argument to the directive.
This also has the side effect of not merging the content to a single
string, meaning formatting will be preserved as expected.
Change-Id: Ie2f011f4a2a0e4918b65bd2387ee2c41f4ae9ec2
Closes-Bug: #1702453
This information used to be in openstack-manuals/doc/config-reference.
Change-Id: I219dee590a706924978ce8d2a2c151a6ae51c8b6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None
Change-Id: I0a99014f983c24a8d36533e36cf56ed8d7a74c5c
Address some of the challenges the sample config generator has when
dealing with dynamically created groups and with options that may change
based on a driver or other plugin selection.
Change-Id: I66b195835a7db3e32b16ddac2166782ff8592806
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
With snap packaging (see snapcraft.io) the package is installed into a
read-only squashfs filesystem, which includes the default config. For
example, $SNAP/etc/nova/nova.conf. To override the defaults, a separate
writable directory is used, and this directory is also unique to the snap.
For example, either $SNAP_COMMON/etc/nova/nova.conf, or
$SNAP_COMMON/etc/nova/nova.conf.d/ can be used to override config.
This patch adds these snap directories to the default config paths where
oslo looks for config.
For more details on $SNAP and $SNAP_COMMON please refer to
https://snapcraft.io/docs/reference/env.
Change-Id: I83627e0f215382aedc7b32163e0303b39e8bccf8
Closes-Bug: 1696830
html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.
Changing Popen to .check_output because of 3 reasons:
1. check_output() will raise CalledProcessError if
the called process returns a non-zero return code.
2. For consistency with keystone [1] and cinder [2]
3. It makes the code look much better.
[1] https://review.openstack.org/#/c/457142/
[2] https://review.openstack.org/#/c/433081
Change-Id: I8872866338d93bc8328391537198df6c7981859f
The test fixture for oslo.config always sets enforce_type parameter in
set_default, however because of debtcollector, this means it also
always emits a deprecation warning as well, even when the caller never
set this parameter.
oslo.config's fixtures should not trigger deprecation warnings during
normal usage. So be extra careful and fix that.
Change-Id: I5471b5d164ff40785e07b5f66e1f4673cf716971
There's a lot of shuffling docs around, but the main point is to
document the application parameters and the support for multiple output
formats recently added.
Change-Id: I26827801df917619d4256ef4c718051f5c395a29
Implements: bp machine-readable-sample-config
The latter results in 'u' prefixes to most strings, and 'str' generally
exposes something more human-readable than 'repr'.
Change-Id: I8cf0cc0593341c92a6798e75ee2aeff3115ebda5
Changing Popen to .check_output because of 2 reasons:
1. check_output() will raise CalledProcessError if
the called process returns a non-zero return code.
2. For consistency with keystone [1] and cinder [2]
[1] https://review.openstack.org/#/c/457142/
[2] https://review.openstack.org/#/c/433081
Change-Id: I1033016ffdaa83e216cffab7cf9713bee7fba758
At some point in the development of this feature, I cleaned up an
"unnecessary" loop that was writing the generator_options. It turns
out this wasn't as unnecessary as I thought. A ConfigOpts instance
looks dict-like enough to pass the unit tests, but when it's
actually passed to the yaml formatter it fails because yaml doesn't
know what to do with it.
Instead of reintroducing the loop, it seems just casting the
ConfigOpts to a dict will work.
Change-Id: I0aaac8485259cc80a430bb80684d1bfe1c7f91c3
https://review.openstack.org/451081 added a requirement on PyYAML
without explicitly including it in requirements.txt
Change-Id: Ib11f5262f3cfd451eeaf0bd4a0374ab7bbc38058
Adds the ability for the sample config generator to output the
config data in the machine readable formats yaml and json.
bp machine-readable-sample-config
Change-Id: I236918f0c1da27358aace66914aae5c34afef301
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
The oslo.config file format permits multi-line values for options,
however all the lines except for the first one need to be indented.
Right now oslo-config-generator fails to take that into account, and
instead outputs the formatted value as is, adding a comment character
only to the first line, and not commenting out or indenting the
subsequent lines.
This patch tries to fix that by adding a comment character and some
indentation to every newline in the formatted value.
Change-Id: I33381c8cfb59901ce6dfc07bd662f2edb56531dd
Closes-bug: #1689594
When we log the warning that an option is deprecated for removal,
include the reason if we have one. Previously the deprecation reason was
only visible in the sample configuration file.
Add some tests for the log messages emitted when deprecated options are
used.
Change-Id: I5e309a3651041580fdf529ff31e18bbd90714f35
Signed-off-by: Doug Hellmann <doug@doughellmann.com>