Using oslo.config objects in pickle leads to multiple import problems on
deserialization. Since we don't actually need oslo objects, we convert
them into dicts before dumping them.
Change-Id: Icbd1a3957e4d4ae05fe6227fbdd1cb58e5a3a98d
These folders used to bring command line options that we don't want to
have in the generated tables, but the behavior has changed. This patch
restores the import of files in the cmd/ folders, and handles special
cases where the import is problematic.
Change-Id: I0779e0f689d2f6f64149c3d111a8dd1ecd6cfc20
Partial-Bug: #1363954
Specifying the encoding and working with unicode strings in not
supported in lxml. The BASE_XML string is only used to init the XML tree
and does not need a specific encoding. The utf-8 encoding is explicitely
added when the final XML is written to file.
Change-Id: I74e0a316cf718ad9768a690f8ccc4a1cc9a9fc7e
We use trickery to import the keystone middleware options, which might
result in duplicated opts errors. This patch ignore such errors on the
middleware import.
Also use keystonemiddleware instead of keystoneclient.middleware.
Change-Id: I4e003ec9f4a7a706a2bbdeea5f874624fc59ea40
A previous patch attempted to introduce semantic tagging for
options and their default values in the automatically
generated configuration reference tables.
While this worked well for swift, incorrect code was used
for the XML generation of the main autohelp.py method.
This patch fixes the string based code to use XML subElements
as was already done for extract_swift_flags.
Change-Id: I93a89b726d66acd0778e8365f47d5ee2f2e0b3c5
By marking options as <option>option_name</option>, we get
more flexibility in how to handle them.
In particular, currently these thousands of automatically generated
options are polluting the translation's common resource.
Marking these strings as <option> might allow us to
say "don't translate this".
Change-Id: I0282545d1a2c3ca3d14a5c411c2f5457fbd09780
Most of the default value sanitization happened during the docbook
writting, and not during the 'dump' of the options. This resulted in
invalid values in the xml files produced by diff_branches.py.
This patch moves all the sanitization code to the same function,
ensuring that the sanitization happens during options discovery.
Change-Id: I4d7e5d601baac5294937525ede8655da6b25e6cf
Some help strings have a trailing space that make our tests fail. These
spaces should be removed from the help strings in the projects, but it
takes time and we often end up editing manually.
Help strings from the oslo incubator might already have been fixed but
not yet imported in the projects, so no proper solution exists in this
case.
Change-Id: I606f46b23a4c5a5114bb5577273657fdf4fa5295
To avoid duplication of entries, use a shared headers file as fall back.
Co-Authored-By: Gauvain Pocentek <gauvain.pocentek@objectif-libre.com>
Change-Id: I639a299d5b1d1e91b81ab15fc6ba2a93f35017a9
wrapper:
- Don't modify the openstack-manuals repo if it exists, keep it as is
git wise (no branch change, no pull)
- Install oslo.i18n and hplefthandclient
- First setup the environment, then do the update/docbook work
autohelp.py:
- Handle projects not using oslo.i18n (mostly for havana)
diff_branches.py:
- Update the output format
- Setup the venv for the requested projects only
Change-Id: I48c45a56f4b7b7298fef0b7595d62e445c92df39
Some module imports fail without a proper setup of oslo.i18n, so make
sure that it is the case for projects using this package.
Change-Id: I7082cb893ccb52fa7bf065a01655efb9a5bbd4e2
This patch also reworks the autohelp _sanitize_default to wotk on an Opt
object instead of its name and default value.
Change-Id: I2b1b0dd44f64a49b6e41c9922555cd968822d144
This method disappeared from oslo, so provide our own sanitizer. This is
needed for now but can be removed as soon as projects provide
Opts.sample_default values.
Change-Id: I13e76c75a74667fa9bd3c779a6cf45d0281ed680
Closes-Bug: #1341250
Oslo modules are not used by all the components, so configuration
options might be invalid if these modules are unconditionaly loaded.
This change uses the requirements.txt file of a project to detect if
oslo modules have to be imported.
Change-Id: I7cd81d0c9a5ae43f0a628e2d2a6f664507e54122
We always explicitely pass a target argument to the write_docbook*
functions, so we can't use a default value for it. This patch makes the
target argument mandatory.
Change-Id: I4a193abe2634f21b52ba61c5692fe03061ac7fd3
Require at least 0.9.1 because 0.9.0. had a minor bug.
This change also fixes all found issues.
Rewrote some docstrings to fit H405.
Change-Id: Ifeef11b783dbe70b2652d2b9ea29d5b20f69f2ce
diff_branches.py generates a listing of the configuration options
changes that occured between 2 openstack releases.
This involves a few changes in other tools:
- the 'dump' subcommand for autohelp.py generates the serialized dict of
options
- add a special case for the 'bindir' option to avoid getting different
default values in different virtual environments
- the autohelp-wrapper -e switch builds the needed venv without
running autohelp.py commands
Change-Id: I80da172b91b8d2f0a15f89f4c812864da2fea471
Avoid duplicated data (mainly headers and footers for table files).
Also reformat the generated output to avoid having too much white
spaces.
Change-Id: Ib7ff29ae6d3180a401c5cac482e82a56997751a7
- generate the tables in the doc/common/tables dir by default
- make the -i switch optional, and assume that git git repositories are
in a ./sources/ dir
- use elif's instead of multiple return statements in the subcommand
test
Change-Id: If96ac9df247cea5061c056328307ec88ab74a4f3
The common.py file is only used by autohelp.py, so is not really a
common file. Include its content in autohelp.py.
Also remove the unused _() definition.
Change-Id: I4e228637e3f6287fd2770ba386dd0fdba6977a81
There's nothing introspectable in the projects or oslo.rootwrap, but all
projects that use rootwrap have a sample etc/($project/)?rootwrap.conf
file. This file is relatively simple to parse for allowed options and
comments. It's not the best solution, but it's a solution.
Closes-Bug: #1253690
Change-Id: I51973a4b8f0ac6ea047c4ffc07647a10bdea92ee
We don't use the information about defining module anywhere. Using
that routine just makes the code slower and causes crashes in Neutron
and possibly elsewhere whenever an option is defined in the top level
but not registered.
Change-Id: I946c740cd0ce6fa5d969964d79a75a406e8453ab
By default xml files are generated in the working directory, this patch provides
an option to choose a target directory for xml files.
Change-Id: I65d78df8d70d82e5f14e9a175710468ac85b3796