Commit Graph

125 Commits

Author SHA1 Message Date
Takashi Kajinami c40eacd146 doc: Drop oslo.db.concurrency namespace
This is used by TpoolDbapiWrapper in oslo.db which is deprecated.

Change-Id: I1cb605a531c080296952ece3668c4002061e94fd
2024-02-11 14:54:59 +09:00
xuanyandong 604bde417b remove unicode from code
Change-Id: I062829a44a62014e88f285a82b6800e37f00ff28
2021-04-16 11:17:19 +08:00
Moisés Guimarães de Medeiros 05b6a33336 inherit from object is not required for py3
Change-Id: I3f3b1dca78e2e9b2515231ccc6600b64f31039fb
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2021-01-12 17:09:25 +00:00
David Vallee Delisle f2ca66fdc9 Adding --check-defaults to validator
When troubleshooting, it's often interesting to see the deltas between
the default or sample configs and the running configuration. The
oslo_config.validator is a great tool to integrate this feature across
all projects. It can also be easily captured by data collection tools
like sosreports with the current deployment packages.

Change-Id: I172d82f19a81282093b0d5f7ae4c1817801cd887
Signed-off-by: David Vallee Delisle <dvd@redhat.com>
2020-11-24 13:55:33 -05:00
Hervé Beraud 5e1011a630 Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I65a40bbff17d92b959764846801d5e0ddd3b97ce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:25:01 +02:00
melissaml bfec5fd629 Fix pygments style
New theme of docs respects pygments_style.

more info: http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I88f448ac7fc7fb72187eb7bdad5bf19f327d8641
2020-06-04 16:00:30 +08:00
Stephen Finucane df5e5db191 docs: Mention other ways of escaping '$'
oslo config code treat treats the '$' as a special character and it
needs to be delimited when using within a string. There are two ways of
doing this, '$$' or '\$'. We document the former but not the latter. Fix
this.

Change-Id: I37cdf31ba1c2924779a46b1a2eeabb66c46a2212
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1872839
2020-05-01 16:04:34 +00:00
Hervé Beraud c89ddcdf40 Add release notes links to doc index
Change-Id: Ife6a9f6ff6116fda3bbb5b6a5987096f22b6f5a9
2020-04-16 15:25:56 +02:00
Zuul d93bfe182e Merge "Use stevedore to list the source drivers in documentation" 2020-03-09 16:12:19 +00:00
Stephen Finucane 4e071eb034 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I13ce8e8264679a19c7b108381ccb969573ea9ac6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Sem-Ver: api-break
2020-02-03 15:12:02 +00:00
Doug Hellmann 1a411ada80 Use stevedore to list the source drivers in documentation
Add a section to the configuration guide to list all of the drivers
using stevedore's sphinx integration.

Change-Id: I6348f83efdd8a572821d2851ee4bd883f9e7e2b4
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2019-12-17 17:08:19 +00:00
caoyuan 0f7244f9dc tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Ied9f46640cf2f338a5784e1c72998f93b5c860c5
2019-10-24 14:04:44 +08:00
Zuul baba7cfd65 Merge "Bump the openstackdocstheme extension to 1.20" 2019-08-09 11:39:15 +00:00
pengyuesheng 039fdae7d2 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: Iac913e9dea8318ad8398ed7478cb66d845fe7f1e
2019-08-01 09:46:12 +08:00
pengyuesheng 1d10674459 Blacklist sphinx 2.1.0 (autodoc bug)
See https://github.com/sphinx-doc/sphinx/issues/6440 for upstream details

Change-Id: I4c4a2083d6578c625b948b1458412b832264f11e
2019-07-30 16:53:53 +08:00
Zuul dea9af2fe9 Merge "Add special handling for keystone_authtoken group" 2019-07-01 17:04:13 +00:00
Ben Nemec 2610dff995 Switch to sphinxcontrib-apidoc
Rather than have the API docs hand-curated and scattered throughout
the documentation, let's use the apidoc module like all of the other
Oslo projects so our API docs are consistent and easy to find.

The documents that were exclusively API docs are removed entirely,
and the ones where API docs were included with other content have
been changed to reference the generated API docs rather than include
them inline. The one exception is the drivers because they are in
private modules that don't show up in the API docs. Those are still
explicitly documented.

Change-Id: I00bdd963e0d4f270c0d4b50c05f420317a137fd5
2019-06-18 16:31:48 +00:00
Zuul 9b454d7289 Merge "Add exclude-groups option to config validator" 2019-06-03 17:27:44 +00:00
Ben Nemec 0c734acf17 Add special handling for keystone_authtoken group
The keystone_authtoken options are created (not just registered)
dynamically at runtime because of a need to not have a dependency on
oslo.config in that library. As a result, there is no sane way to
validate those options.

This change adds a list of known problematic groups that we should
ignore missing opts from. It also adds an info level log message that
we are ignoring them so users know we can't confirm or deny the
correctness of that piece of config.

Change-Id: Ic2b36fe8be872d298a106c3f64905a5b935ced61
2019-05-22 16:36:02 +00:00
Ben Nemec a6313baf65 Cap Bandit below 1.6.0 and update Sphinx requirement
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Cap to the previous version until
Bandit has fixed the problem.

Sphinx 2.0 no longer works on python 2.7, so we need to start capping
it there as well.

Change-Id: Ib8da5b64084d5c9b7b7d896d6b7bb7844c0b9e90
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-13 19:58:03 +00:00
Eric Fried bab1556735 Add a Quick Start tutorial
As a user completely new to oslo_config (well, I had only experienced it
in the already-implemented context of the nova project), I would like to
have had a reference document that provided a step-by-step guide to
writing a simple test script I could use to noodle around.  It might
have gone something like this.

Change-Id: I02ff56f47ac8b93e0ee37eb55b53552059e4da27
2019-05-03 16:11:49 -06:00
Ben Nemec 144e16d532 Document precedence of config sources
Previously the precedence details for the various sources oslo.config
can consume were scattered around the developer documentation (for
example in [0]). Since this is relevant for users too, we need to
include it in the user-focused documentation.

This collects all of the precedence information I am aware of and puts
it on the documentation page for --config-file, --config-dir, and the
sample source driver options.

It also clarifies the file and dir precedence in the developer docs since
previously that was only available in the API docstring.

Change-Id: I41d8ac0f33ea60aea8ba5b150e53d7eafa323457
0: 0bc22839b0/oslo_config/cfg.py (L2095)
Closes-Bug: 1825859
2019-04-23 20:36:29 +00:00
Ben Nemec 2ee2ad69e3 Move user docs to top of index
The user-oriented docs for oslo.config were buried at the bottom of
the index below a pile of developer docs. This made them difficult to
find. Since we have far more users of oslo.config than we do developers
using it we should prioritize the user docs.

Change-Id: I602ee587e4acf1c1436b568906e316b78f104814
2019-04-22 20:55:55 +00:00
Ben Nemec c30d9c0a08 Add exclude-groups option to config validator
When dynamic groups are used, the sample config data may not know
about those group names. As a result, validation of such files will
always fail. This makes it hard to automate config checks since the
output would need to be inspected manually to verify that the missing
options are all from the dynamic group.

Ideally, we would provide some way to map sample config groups to
the dynamic group name used in the actual config, but that would be
more complicated and still might not work in every case if a project
doesn't include sample sections for a dynamic group (although they
_should_ be doing so).

Allowing certain group names to be excluded from validation lets
us to solve this problem in a simple way and maintain validation of
99%[0] of the config options and enables the validation to be scripted
since it won't need manual verification of the error output.

Change-Id: I352fd48f86ecb876fe26a5e50e9a2633af1fff3d
0: citation needed ;-)
2019-03-26 20:00:00 +00:00
Ben Nemec eedab79f44 Add note to docs about CLI opts and config files
CLI opts can also be read from file, so once an option is registered
for CLI use it doesn't need to be registered again to be usable in
a config file. Add a note in the Registering Options section that
explicitly explains this behavior.

Change-Id: Ib75b5c314b96ec4c46f94e2847016a953433f480
2019-03-12 15:28:16 +00:00
Jonathan Herlin b5df53543f Revert "Optimizing the safety of the http link site in faq.rst."
This reverts commit 56377ae72a.

HTTPS is not used on lists.openstack.org

Change-Id: I2d3f6e23e9a0249b30624326ca9134b559456dcc
2018-12-03 23:50:20 +00:00
zhouxinyong 56377ae72a Optimizing the safety of the http link site in faq.rst.
Change-Id: Ice935e6f4e8dac0b8be2d58fead27029c08513b8
2018-12-03 16:32:25 +00:00
Zuul 4e0e72d480 Merge "Add support for looking in environment for config" 2018-11-02 19:58:06 +00:00
Chris Dent ea8a0f6a8b Add support for looking in environment for config
An _environment source is added that looks in os.environ for
values.

Using the environment is on by default, but can be shut down
by setting `use_env` to False when __call__ is called.

The enviroment is inspected before any other sources
of config data but the value is used after command line
arguments and before config file options.

This is done by checking both the command line and config
files and then inspecting the location of the result. If
it is command_line, we use it. If not, we use the environment
value (if any). If there's no environment value, the config
file value is used. If checking the command line and config
file results in a KeyError, the environment value is used,
if set.

The names of the environment variables follow the rules
described in oslo_config.sources._environment.

A new exception has been added: ConfigSourceValueError, this
is the superclass of the existing ConfigFileValueError. The
code in _do_get has been updated to only use
ConfigFileValueError when it is in fact a file from whence a
ValueError came.

Documentation has been updated and a rlease note created to
indicate the new functionality.

Change-Id: I3245c40ebdcc96f8e3b2dc0bab3b4aa71d07ad15
2018-10-17 20:49:05 +01:00
Zuul 8449a0444c Merge "Add release note and documentation for config validator" 2018-10-08 11:40:07 +00:00
Ben Nemec 1f17b823e0 Add release note and documentation for config validator
Change-Id: Id23d7bbb38c6780621f09b2e24c0cc88831bdb1a
2018-09-26 19:49:43 +00:00
Doug Hellmann bd463ee3b6 move some documentation out of the source files
The cfg module is very large, and starts with a huge block of
documentation. This patch moves that information into separate files
in the reference section of the docs. A few formatting fixes need to
be made to have it build cleanly, but the content is not changed in a
substantive way.

Change-Id: I86aa90bbf180b5dc9acbcedb024e5361d49954c3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-19 17:26:38 -04:00
Zuul 45425e938d Merge "User guide documentation for backend drivers for oslo.config" 2018-07-16 23:31:43 +00:00
Raildo Mascena e8c93ea5ba User guide documentation for backend drivers for oslo.config
New documentation sections explaning how to use the backend
drivers for oslo.config, also include explanation on how to
use the remote_file driver.

Change-Id: I45fc2155f6fe2d8bee058dac880afba8bb9bfd53
Blueprint: oslo-config-drivers
2018-07-05 14:44:15 +00:00
Doug Hellmann 6a94cbc6a2 move configuration option list to the configuration guide
We have a section in the reference guide showing the configuration
options built into oslo.config. Move that to the configuration guide
instead so it is linked from the Configuration Guide list at
https://docs.openstack.org/$series/configuration/ like the similar
documentation for other libraries.

Change-Id: I7da159cfaa643c2cc094f6fb1c0aeaa956f3eb77
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-28 10:55:07 -04:00
Doug Hellmann 1319cfb476 improve the documentation for option location information
Fix an error in the example code by setting loc to the Location enum
value instead of the LocationInfo tuple.

Add a cross-reference from the ConfigOpts get_location() method to the
more extensive reference documentation about option locations.

Change-Id: Ic9850afd78a7b42f4e807b04e78729a674942e15
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-13 13:37:16 -04:00
Ben Nemec 198f539bb8 Remove boolean from StrOpt example
I'm not sure why this was here, but it doesn't make sense since
we're documenting StrOpts in this section.

Change-Id: I74c73c8088ec266d1f827bc51b4d78fc7be48a38
2018-04-24 14:12:46 +00:00
Doug Hellmann 7db6a2604d use environment variable to control file location probing
If OSLO_CONFIG_SHOW_CODE_LOCATIONS is set to any non-empty string it
will turn on the ability to see which file has the definition of an
Opt or where set_default() was invoked.

Change-Id: Ie705014dcf331e3c6b3367d2fefbfb9acc091799
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-18 12:26:44 -04:00
Zuul d2f432c2e8 Merge "Follow the new PTI for document build" 2018-03-22 11:43:58 +00:00
Sean McGinnis 7d250abe04 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I46a861f88166b3b2de0a532cc88beef1ef91ab89
2018-03-21 15:59:01 -05:00
Ben Nemec 3a9d653b09 Remove MultiConfigParser
This has been deprecated for quite a while and some of the upcoming
work to be done in oslo.config will be easier if we don't have to
deal with this unused parser too.

The class is still currently in use in networking-cisco, but in
change https://review.openstack.org/554617 we have provided a fix
that removes their reliance on it.  They are planning to remove it
entirely in Rocky and are only testing against a capped version in
Queens so we are not going to wait on them.

Change-Id: Id6ae40311f967e172e45bcb0e61812365a72618b
2018-03-21 14:54:17 +00:00
Doug Hellmann 835cad6aa0 add user documentation for get_location()
Change-Id: I35ef216552b0b8def9c70b262825acb4a50083f4
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-15 10:14:03 -04:00
shangxiaobj 675e096a19 Fix the invalid links for doc file in oslo.config
Replace the invalid links with the right ones for the document
according to the newest Openstack website.

Change-Id: Id94551a864710231a9d9d23d8632a86439cd61bd
2017-12-28 01:21:45 -08:00
Yaguo Zhou 7fde851f8d Remove redundant colon in doc
".. code-block:: shell" appears in the generated doc html by mistake
because of the redundant colon in the doc source

Change-Id: I5c54fd48a7705cb7d84016707a4bb51e8dd79b2a
2017-08-29 00:00:41 +08:00
Akihiro Motoki 938077097f doc: Specify openstackdocs theme
Change-Id: If3e04107bc2c4bb4c152e79650f8be870bf4721f
2017-07-08 23:00:24 +00:00
Doug Hellmann 675d62220c switch from oslosphinx to openstackdocstheme
Change-Id: I13211d11ae96a8bbc5f8bbb958473dbcf6e4c844
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-29 14:35:34 -04:00
Doug Hellmann c6dded3b6c import content from the configuration reference guide
This information used to be in openstack-manuals/doc/config-reference.

Change-Id: I219dee590a706924978ce8d2a2c151a6ae51c8b6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-29 14:31:39 -04:00
Doug Hellmann c9dd8f3a4b rearrange docs based on new standard layout
Change-Id: I5a86fc144c628772c750e8626d0728e3782ea469
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:17:27 -04:00
loooosy d94cdf8596 Fix html_last_updated_fmt for Python3
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
2017-06-13 11:09:21 +08:00
Stephen Finucane 010e6be5f9 Rework the 'oslo-config-generator' documentation
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
2017-06-07 17:40:23 +01:00