Commit Graph

111 Commits

Author SHA1 Message Date
Stephen Finucane d3c952064a Remove 'autogenerate_config_docs'
This tool has been superseded by the 'oslo_config.sphinxext' Sphinx
extension and can finally be put to rest.

[1] https://docs.openstack.org/oslo.config/latest/reference/sphinxext.html

Change-Id: Idae5ba656c3a0da8a26c6f1e63332365c8012c0b
2017-10-04 11:47:56 +01:00
Jenkins 5d20c21aee Merge "[autohelp] Update opt types" 2017-05-01 12:15:43 +00:00
Gauvain Pocentek 4534f04bad [autohelp] Update opt types
Copy/paste (mostly) the dict from oslo.config.

Change-Id: I16c9e554f29f7dee08768d4a7c02991ad8718f66
2017-04-28 17:53:40 +02:00
Gauvain Pocentek 53de7deb1c [autohelp] Return options as dicts instead of lists
This patch updates the _format_opt method to return a dict instead of a
list. This makes the RST templates easier to read and maintain.

Change-Id: Ia1b494b8ec8ed1e523ebe7198bcba00594e21ac5
2017-04-28 17:48:33 +02:00
Stephen Finucane efdab278fc Actually skip 'update' when flagmapping are disabled
A 'return' was missing, meaning we still built flagmappings.

Change-Id: I01170097e06f2f44152dd0cbd57889f66f9758f4
2017-03-22 16:05:19 +00:00
Stephen Finucane 81f7a8f75a option.help can be None
Handle the case where option.help is none, meaning we can't use
'startswith'.

Change-Id: I0d7dceeed89ad287b9786f04bf8dc9aba1b845dd
2017-03-22 16:05:19 +00:00
Jenkins b398e23e6e Merge "trivial: Remove 'pass_through'" 2017-03-21 22:37:53 +00:00
Jenkins 3a47ece53b Merge "Make flagmapping optional" 2017-03-21 22:37:47 +00:00
Jenkins b7a91f869f Merge "Separate option formatting" 2017-03-21 22:37:03 +00:00
Jenkins cf594c5b1f Merge "Index options by group too" 2017-03-21 22:36:58 +00:00
Jenkins 4b6583d302 Merge "Simplify the format of paragraphs" 2017-03-20 19:15:38 +00:00
Jenkins 1c9722d637 Merge "Include 'deprecation' as a flag" 2017-03-20 17:01:50 +00:00
Jenkins ca669fa378 Merge "Remove unnecessary parameter" 2017-03-20 17:01:36 +00:00
Christian Berendt 9a7a07dde1 Handle object type when registering runtime options in autohelp
Change-Id: I9800c7ae467a807c0e6b6bca6784aace2140c75b
Closes-bug: #1672377
2017-03-13 14:28:15 +01:00
Stephen Finucane b4492e34f9 trivial: Remove 'pass_through'
This doesn't warrant it's own function and makes this a little more
difficult to read.

Change-Id: Ieff01bc97dc54b8ff68bff577803d41b921a1375
2017-03-10 11:34:18 +00:00
Stephen Finucane d962670652 Make flagmapping optional
Support for flagmappings was useful in the days before OptGroup was
available. Today, it's mostly a burden and not necessary for projects
such as nova. Make this feature optional, allowing us to make use of
built-in oslo.config where available.

The actual flagmapping files themselves are found in another project and
cannot be removed here. This will be done in a separate change.

Change-Id: I27296954ad8ce2010fc464ad81c8da4859ba2531
2017-03-10 11:34:12 +00:00
Stephen Finucane 88ae9f08ac Separate option formatting
We're going to add another code path for projects that rely on
oslo.config's 'OptGroup' to group their options. To minimize
duplication, we should drag the option formatting into its own
function.

Change-Id: I755489036758d589240d9c057e6fcb109de68fde
2017-03-10 11:20:28 +00:00
Stephen Finucane d77ab16161 Index options by group too
We will use this in a future change.

Change-Id: I0e0f0b84ee10cf2003d9eae349aee0c4b99cb69c
2017-03-10 11:20:28 +00:00
Stephen Finucane 2860b9df09 Simplify the format of paragraphs
There's a rather complicated bit of code used to split blocks of text
into paragraphs. Replace this with something a little simpler that makes
use of our paragraph-ization rather than trying to rebuild blocks of
text.

Change-Id: I321ba57d0f7090afec34c6207f9a42493b8a3249
2017-03-09 15:20:11 +00:00
Stephen Finucane f0a146d112 Include 'deprecation' as a flag
There is support for displaying deprecation information in a somewhat
structured manner (proper lists, emphasis on titles, etc.). However, the
deprecation information is still included in the help text rather than
in this flags section. This makes things more difficult than they need
to be.

Resolve this by instead including any deprecation information in the
flags section. This will transform output from something like this:

  (String) DEPRECATED: Host to locate redis. Replaced by
  [DEFAULT]/transport_url

to this:

  (String) Host to locate redis.

  Deprecated
    Replaced by [DEFAULT]/transport_url

Which should be a little more obvious.

It's necessary to fix the template, which added the flags at the same
level as the title and description, resulting in varying numbers of
bullet points for the list.

Change-Id: Ifaee90a814fa3efee8b41eb0411535cff70e7309
2017-03-09 15:19:53 +00:00
Stephen Finucane cebdd125e1 Remove unnecessary parameter
With the removal of docbook support, we now support a single type of
output. As such, the aforementioned option is surplus to requirements
and can be removed. Do just this.

Change-Id: Ib9d49fd465ecceb92075495de966b2189a371103
2017-03-09 13:46:21 +00:00
Sreedhar Varma a46d872d3c Fix TypeError in autohelp.py
The command "./autohelp-wrapper update cinder" is throwing
"TypeError: sequence item 0: expected string, int found".

This error is due to using ", ".join on the
list of integers in autohelp.py.

Change-Id: Ib4142466d15534adbdade8ebd8724a954f50e95d
Closes-Bug: #1651738
Co-Authored-By: Nikesh Mahalka <Nikesh.Mahalka.ctr@kaminario.com>
Co-Authored-By: Alekhya Mallina <alekhyam@biarca.com>
Co-Authored-By: Srinivas Dasthagiri <srinivasd@biarca.com>
2016-12-21 07:45:15 -05:00
Christian Schwede c93f4853f6 Make hooks module import optional
There is no hooks module available when running the
extract_swift_flags.py locally, so making this import optional.

Change-Id: I65ebacd1e3e4cf66ece0a9fcbbc785d79278e8bb
2016-12-02 16:26:56 +00:00
Jenkins 055b43e4f2 Merge "Remove docbook" 2016-11-22 10:55:27 +00:00
Alexis Lee 855daa63f6 Remove docbook
From autohelp-wrapper and autohelp.py, as it's no longer used.

Change-Id: I44d5c37c70b8b4fc0b938b6ba0c2fed5a448c265
2016-11-22 10:20:20 +00:00
KATO Tomoyuki 3677deffaf [config-ref] fix pattern matching for bullet list
Change-Id: Ie42afc0fd1c1a75ecb5f599571f2f96f364daf38
Partial-Bug: #1638004
2016-11-12 20:44:00 +09:00
KATO Tomoyuki c8f4375527 [config-ref] support URIOpt/HostnameOpt to auto config doc tool
Change-Id: Ib045b60de82cd3761503d2e329eddcbbd044925e
2016-10-13 13:20:18 +00:00
KATO Tomoyuki 858b94199d [config-ref] support IPOpt into auto config doc tool
Change-Id: I319524933eb377a47c9ec5bd862ac3825c967548
2016-10-13 17:25:42 +09:00
Jenkins 99159d1a4b Merge "[config-ref] Remove heading and trailing blanks from help" 2016-10-01 07:54:10 +00:00
KATO Tomoyuki 1057a48575 [config-ref] Remove heading and trailing blanks from help
Not to break the script with the heading and trailing blanks.
It happens at glance with oslo.i18n deprecation messages.

Change-Id: I33ab7a815fc092cef2ed0688b0693c23802b23c6
2016-09-30 21:01:05 +09:00
KATO Tomoyuki dfa602df09 Remove unnecessary white space
To fix the pep8 warning:

  E211 whitespace before '('
  print ("Duplicate option name %s" % optname)

Change-Id: Id041e12754679538cd6dab6fdc25b357ee628389
2016-09-30 20:41:29 +09:00
Jenkins 787b48019f Merge "Changing 'raise e' to 'raise' to prevent exception masking" 2016-09-05 08:03:27 +00:00
KATO Tomoyuki 6842c4b774 [config-ref] support cfg.PortOpt type by the generation tool
Change-Id: I99aabfadcadbadac6c8cfc552dc4f99837df5e81
Partial-Bug: 1603082
2016-08-03 11:21:47 +09:00
KATO Tomoyuki 3725c14c62 [config-ref] skip options marked as disable
The common configurations are described in the common
configurations table. The corresponding configutations
at each table are not necessary.

Change-Id: Ied2d03d1c7f71f5712fcf57d4499e127db327b7d
Implements: blueprint config-ref-common-sections
2016-07-26 04:03:42 +00:00
Matt Smith 307344f7a8 Changing 'raise e' to 'raise' to prevent exception masking
Change-Id: I5786ef33368f251815f6acbf97a15990562ffb85
2016-06-17 09:52:08 -07:00
Jenkins 10c6b0236d Merge "Allow bulleted lists in config reference" 2016-06-16 08:27:16 +00:00
Alexis Lee f8bff99285 Allow for config option flags
Add a definition list under the help text to detail pertinent flags.
Make 'mutable' one of these flags.

Change-Id: Idc0080be25db12485b33be421c5557d78418823c
2016-06-08 22:31:24 +00:00
John Garbutt 4f0433ffce Allow bulleted lists in config reference
This is very much a hack, but its really just to see if it is possible
to convert the bullet lists into text that renders correctly with rst.

This was tested with the nova-hyperv.rst:
f0607509e3/doc/config-reference/source/tables/nova-hyperv.rst

Change-Id: Iab063774f6732d52cd8e79f82ff0fc93bd6d306b
2016-05-27 08:41:04 +00:00
ZhiQiang Fan e115fee6a3 safe get deprecated_reason
when run ./autohelp-wrapper rst aodh, it failed with:
AttributeError: 'BoolOpt' object has no attribute 'deprecated_reason'

we need to check the value before we use it

Change-Id: I362606ba186d1582f850bfa4d602503d6ea5079a
Closes-Bug: #1573953
2016-04-24 01:51:38 +08:00
Ronald Bradford cba7f7f340 Better identify deprecated configuration options
If a configuration option is tagged as deprecated in the code and the
help text does not start with DEPRECATED: add this to better identify
options that are no longer used.

If the code provides an additional deprecated reason, append this to
the provided help text of the configuration option.

Change-Id: I1a7c76c0109a6e59cc87d0ddc942c6d1cfb9dc91
2016-03-16 18:08:07 -04:00
Ronald Bradford 557d0af6d0 Provide a more human identifable option data type
Update the configuration tables option type from an internal meta type
to a more meaningful description.  E.g. Boolean for BoolOpt, String
for StringOpt, Multi-valued for MultiStrOpt etc.

Inspired by the translation used in Developer Docs

Change-Id: I5bd7aec727292ceef4dc0ff56ab8f334ea2f22bc
2016-03-16 17:32:35 -04:00
Ronald Bradford 4bca964706 Catch sqlalchemy.exc.InvalidRequestError exception
Running update of keystone produces the following exception which
teminates processing. This enables processing to continue, like
capture of other types of errors.
* Table 'federation_protocol' is already defined for this MetaData
  instance.  Specify 'extend_existing=True' to redefine options and
  columns on an existing Table object.

Cater for projects that do not use sqlalchemy, e.g. swift.

Change-Id: I87df4bb784f94b7194374b2448e4c34beadb923f
2016-03-16 17:32:08 -04:00
Jenkins a19eef20ce Merge "autohelp: avoid duplicated overriden entries" 2016-01-24 12:11:29 +00:00
Gauvain Pocentek d0c8b278de autohelp: fix poor behavior of _sanitize_default
Change-Id: I9a9d41785c7674056a6d553941510ca1e5b30383
2016-01-24 11:53:25 +01:00
Gauvain Pocentek 5dc95bfb6b autohelp: avoid duplicated overriden entries
Change-Id: I99e3f9735ec1baf8d514088ec3942bfe76895a2a
2016-01-24 11:18:56 +01:00
Gauvain Pocentek e436173ae2 Move the config items in the manuals repository
Modifying configuration options (ignored modules, extra repositories,
hooks) for autohelp requires an update of the doc-tools repository,
which doesn't make much sense since the goal is to update the manuals
repository.

This patch removes the configuration options from the repository and
updates the scripts to use the configuration items in openstack-manuals.

Change-Id: I630d2a2fea690f6360039aa100331678468d18dc
2016-01-11 08:52:33 +01:00
Gauvain Pocentek e3c42a269d `autohelp update` can create the flags file
If the flagmappings file doesn't exist the function will create it,
with all the sections set to Unknown. This mimics the behavior of the
`create`, not needed anymore.

Change-Id: I7a920300b784aa8fca6412c292d807beb4d5c8e5
2016-01-08 09:09:58 +01:00
Gauvain Pocentek 658c74dd7e [autohelp] config-ref-rst moves to config-reference
Update the default paths to make the scripts work after the config-ref
publication.

Implements: blueprint config-ref-rst

Change-Id: I55534d08b10af4fb44a7dd22718ae22e44708559
2015-12-20 20:56:08 +01:00
Gauvain Pocentek e8784d29c7 [autohelp] display information on import error
When a module import fails the wrapper script doesn't display its
path/name, so it is complicated to debug. this patch displays the module
name before re-raising the exception.

Change-Id: Ie9d691a41b0c178b856f19605a8c6434d3ce2c88
2015-12-17 17:54:53 +01:00
Gauvain Pocentek 5c743c3d4a [autohelp] allow overrides of sections
We want to be able to change the section in which an option is
registered in the documentation. This patch uses a <project>.overrides
file to define in which section(s) an option should be moved.

The format of this file is (1 line per option):
[<group>/]<option> <new_group1>[ <new_group2> ... ]

Change-Id: I9fd0b763b6e56cd360694566de7f3acc3172c9c1
Closes-Bug: #1522794
2015-12-05 15:09:53 +01:00