23 Commits

Author SHA1 Message Date
Gauvain Pocentek
d0e1a97df9 Improve the autohelp scripts
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
2014-08-23 09:11:17 +02:00
Gauvain Pocentek
cccee65b46 Update sanitizer to handle '/sources' in pybasedir
Change-Id: Icafe29f1b64c2ce406f73fa7ebc93f97592c5313
2014-08-19 13:56:25 +02:00
Jenkins
52c86659af Merge "autohelp: make sure that oslo.i18n is setup" 2014-07-29 08:10:33 +00:00
Christian Berendt
760b421951 Replace usage of readlines()
Change-Id: Ic4c0af29f900b274b1a4b45d2e55f0012107d47c
2014-07-29 09:51:17 +02:00
Gauvain Pocentek
07fd34f29d autohelp: make sure that oslo.i18n is setup
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
2014-07-29 09:33:19 +02:00
Gauvain Pocentek
88db667694 sanitizer: handle values ending with spaces
This patch also reworks the autohelp _sanitize_default to wotk on an Opt
object instead of its name and default value.

Change-Id: I2b1b0dd44f64a49b6e41c9922555cd968822d144
2014-07-23 07:38:56 +02:00
Jenkins
930256f72a Merge "Don't use oslo's _sanitize_default" 2014-07-16 18:58:23 +00:00
Gauvain Pocentek
3854794b3a Don't use oslo's _sanitize_default
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
2014-07-13 22:51:34 +02:00
Andreas Jaeger
ef07792647 Update XML root elements
Write our root elements in a consistent way.

Change-Id: I3f74cc7fd0346c44b2cf445bb4f8638af4c70e4b
2014-07-10 08:39:55 +02:00
Gauvain Pocentek
05fcf72428 Use lxml to handle the XML data
Use lxml to read/write the docbook data. This avoids dealing with
manually indented string.

Change-Id: Ia4e30105f5197214144a0391d0908c94a5397983
2014-06-29 19:41:56 +02:00
Gauvain Pocentek
24df23a5a3 autohelp: import oslo extensions only if needed
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
2014-06-28 20:59:41 +02:00
Jenkins
cd10913a77 Merge "Bump hacking to 0.9.x series" 2014-06-17 15:28:30 +00:00
Gauvain Pocentek
a2da2135f1 Fix the target argument
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
2014-06-16 21:21:11 +02:00
Christian Berendt
d449a6bcd2 Bump hacking to 0.9.x series
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
2014-06-12 09:17:22 +02:00
Gauvain Pocentek
bdb2f2f003 Provide a script to gerenate options changes
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
2014-06-10 22:50:46 +02:00
Gauvain Pocentek
6bf1f2b7e7 Refactor the generation of docbook data
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
2014-05-13 15:01:03 -04:00
Gauvain Pocentek
ded3788ff3 autohelp.py: update the paramters handling
- 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
2014-05-13 07:28:08 -04:00
Gauvain Pocentek
fa80be3495 Don't use a common file
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
2014-05-10 21:32:05 +02:00
Shaun McCance
eb51a3d4bf Generate docs for projects' rootwrap.conf file
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
2014-04-06 14:02:01 +02:00
Gauvain Pocentek
62e2d211f2 Minor cleanup
Remove unused modules dict.

Change-Id: Ieabffe4450a75beb45a1374b046fa32b65105868
2014-03-11 17:40:37 +01:00
Shaun McCance
e022b352d1 Stop using generator._list_opts; use cfg.CONF instead
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
2014-03-07 15:56:52 -05:00
Gauvain Pocentek
be83c24c9b autohelp.py: add a --output option
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
2014-03-02 09:44:55 +01:00
Andreas Jaeger
b226f80820 Rename autogenerate-config-docs to autogenerate_config_docs
Minus signs are not allowed in python package names, thus rename the
directory.

Change-Id: Ie4b7cdff301673fdc0afe49c5b7211ee003871e5
2014-01-21 17:00:22 +01:00