The patch extends the documentation for `DeprecatedOpt` and explains
that group==None means the deprecated name will be looked up in the same
group.
Change-Id: I54ba414d6a6862e1b00dfbf589563ef9f4df5cf3
For example when having an argument with possible choices and the used
choice is not available the stderr output is like the following example.
argument --formatting: Invalid String(choices=['check', 'fix']) value: fixaberendt@zitrone
To have the shell prompt at the next line it necessary to at '\n' at the
end of the stderr output.
Change-Id: I99152e69bb090ea5d7102cc85d60498c3c6213eb
Changes imports order to pass H305 check with hacking 0.9.x
Removes H305 check from ignore line in tox.ini
Change-Id: I47bbe74f4178f46ea21fc37b69f53ea2d148a65e
If a MultiStrOpt default is set to None or [], the best thing to do is
just add:
#multi_str_opt =
to the sample config file.
Change-Id: Ibaee466978870082be47a2135ae3f412d3efd623
We appear to have stopped doing these since the 1.2.0 release, but I
like to do them because it helps highlight new APIs, behavior changes,
important bug fixes, new dependencies and also allows us to credit the
contibutors in a nice and friendly way.
Change-Id: I7dd6641a840dee0082c6c9e9216184f385869519
According to the IBM Style Guide the Latin abbreviation 'e.g.'
should be replaced by 'for example'.
Change-Id: Ie85eec0f028a927a635303f7c13e76fe52a92ff5
Add a new class designed to wrap cfg.ConfigOpts, with the following use cases
in mind:
1. Help enforce that a given module does not access options registered by
another module, without first declaring those cross-module dependencies
using import_opt().
2. Prevent private configuration opts from being visible to modules other than
the one which registered it.
blueprint: oslo-config-cfgfilter
Change-Id: I477f7027806d7630ce91159fb274f41c0c203770
Now that we have an Opt.sample_default attribute, it's not very clear
we have a good use case for the sanitizer feature. Any default that we'd
want to sanitize in this way could probably just use sample_default
instead.
blueprint: oslo-config-generator
Change-Id: Ifd02bb66a2033afdaa5812b15941d2d485165863
Some default values for configuration options are dynamic and
environment dependent. For example, an option might default to the
hostname of the machine.
However, such default values should never end up in a sample
configuration file - you don't want your hostname or path to your
personal home directory to be included in sample config files.
A simple solution to this is to add a 'sample_default' string
attribute which is used in place of a default, for those cases where
the real value is an unsuitable sample default. For example:
cfg.StrOpt('hostname',
default=get_my_host(),
sample_default='myhostname')
blueprint: oslo-config-generator
Change-Id: I319d128a0a88b1197d8e2be105681f2b56240439
This code was just confusing. Explicitly handle MultiStrOpt differently
from other types to make things more clear.
Change-Id: Ib6a01f76595c8874809c4d6db969ea8200d6fbb2
In order to validate correct input values for IP addresses new Opt was
introduced. Validation is done on parsing level so there is no need to
explicitly check for valid ip address in the code.
Requirement for netaddr package was added.
DocImpact
Change-Id: I9adc30d9b989e8c636fefd435885c4c363ca540c
Partial-Bug: #1284684
The original implentation of _Namespace._get_cli_value relied on the
fact that _Namespace.default doesn't exist and accessing it would raise
an AttributeError. This attribute was being caught for another reason so
the logic just worked.
The more correct thing to do would have been to just raise a KeyError.
This change does that and removes the need to catch an AttributeErrors.
Change-Id: I963b31ea6ea8ab5180314be7cd2450395263e1af
Closes-bug: #1284968
Add a sample config file generator utility. This is a dramatically
different approach from the generator in oslo-incubator, whereby we move
away from magic towards much more explicit control over the generator.
blueprint: oslo-config-generator
Closes-Bug: #1300546
Change-Id: I15686708fc9460948a58cfea3d18dae40ba1fda9
oslo.config.fixture.Config has register_opt() and register_opts() but
not register_cli_opt() and register_cli_opts().
Change-Id: I8a1582dc0deb0230eb02b0894a49398f333375fe
Add a warning explaining that options in groups cannot be used with
the interpolation syntax.
Reformat note to use directive so it is highlighted.
Add "docs" section to tox.ini to make testing doc build easier.
Change-Id: If5106aa44d4c87abe84a7fb7a250541bba9f5068
Add some tests to show the broken behaviour in #127993 and to help
ensure that fixing it doesn't break correct behaviour in other places.
Related-Bug: #1279973
Change-Id: I69b2c4e3f27a3e193ca10cef32dd752d6a6fcc8b