Commit Graph

45 Commits

Author SHA1 Message Date
Jake Yip ad9c2042cf fix spelling
Change-Id: I5d42c30498b3e38d9ff979aea02232a13c5aa261
2023-06-16 17:26:33 +10:00
xuanyandong 2eb27aa5ae remove unicode from code
Change-Id: I5efbe90ec103fbf25412b2dc2cc6d85ccbb90f83
2021-01-03 16:18:03 +08:00
Hervé Beraud d023c60c74 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: Ifc5ee35d399c628604ec1644eb447936803c45f5
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 11:17:45 +02:00
melissaml 69dd162b7c 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: Ieaa8a37dbd07ec0312fee1cefd85973140fd9503
2020-06-04 15:25:17 +08:00
Zuul c5207d24ce Merge "Add release notes links to doc index" 2020-05-28 09:44:58 +00:00
Andreas Jaeger 620c6689e9 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

Depends-On: https://review.opendev.org/728938
Change-Id: Idc8d870e5c12e18efd07427eb1772d0f4e65d262
2020-05-18 21:09:23 +02:00
Hervé Beraud aab7306696 Add release notes links to doc index
Change-Id: I98b08205c9c22430be019d4e30ec3e788087b940
2020-04-16 17:49:50 +02:00
Andreas Jaeger d9718805c1 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Update classifiers
- Use newer openstackdocstheme version
- Switch to hacking 3.0, fix problems found

Change-Id: I539b00204279c7645ef4a3f804f64a1e7af30f05
2020-04-13 11:16:21 +02:00
Hervé Beraud 0f769d4c9f [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: I8604e1a22d7cb13251e2ef22ef86318ad2de346e
2020-02-03 18:15:43 +01:00
caoyuan 31abe71ff6 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: Ic68b7acf92512255d4e1e3c2e5d3b6ff795e1354
2019-10-24 14:58:33 +08:00
Zuul 19bf721b6c Merge "Blacklist sphinx 2.1.0 (autodoc bug)" 2019-07-08 03:18:29 +00:00
pengyuesheng 250c571c00 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: Ibba92185735ed6b41486678fab6390a3168888e2
2019-07-05 09:24:52 +08:00
pengyuesheng 476b46e7ed Blacklist sphinx 2.1.0 (autodoc bug)
See https://github.com/sphinx-doc/sphinx/issues/6440 for upstream details
Depend-On: https://review.opendev.org/#/c/663060/

Change-Id: Idc95dd7ecad8f93d03960038af74aea3c55d93d2
2019-07-04 16:51:17 +08:00
Ben Nemec d2e62c152a 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: Ifdad77dfc957ed90da88efe729cc6b35e96f0392
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-15 15:23:22 +00:00
jacky06 f0a9926b11 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I0ab27098deb48de60b4d93cbedf59c1d0aa4f318
2019-04-30 13:45:14 +08:00
OpenStack Proposal Bot 1c50f5e0bf Updated from global requirements
Change-Id: I6d677d3d160c5730e7e2d8b00211eac22fe1a918
2018-03-21 08:56:07 +00:00
ZhongShengping f277b87703 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: I35fb490d34af834182522a856d6ab7e24d0ec678
2018-03-02 10:30:19 +08:00
Akihiro Motoki 01f537995e doc: Specify openstackdocs theme
Change-Id: I26d4bfc97d20edb75a4c255ca0f80fe9b43ad2cd
2017-07-24 01:18:18 +00:00
Dong Ma 9118502133 switch from oslosphinx to openstackdocstheme
Change-Id: Iadf4ea330b79dd81e5eed98b145798fe29c64c70
2017-06-28 14:32:18 +08:00
Dong Ma 6efcbd9936 import admin guide content from openstack-manuals
Change-Id: I9d2cda5f050801e0cc51eac5876b5cb707caff43
2017-06-27 16:34:01 +08:00
Dong Ma a2780e0cfc rearrange content to fit the new standard layout
Change-Id: I299b6da1fcb8a7a6a6524cfa5d9892a6c2643c18
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
2017-06-26 23:22:28 +08:00
Julien Danjou b52832570f Suggest to use egg based filter_factory rather than fragile full path
This makes sure that if the module organization change, nothing breaks.

Change-Id: Ib4fb1e2210a9cea6b12214e0d1e3570086ac2e68
2016-11-29 14:43:22 +01:00
Jenkins 7563191932 Merge "Deprecated set_latent" 2016-10-17 03:38:44 +00:00
Michael Krotscheck 399e94043f
Deprecate multiple config block parsing.
With the introduction of set_defaults, as well as new documentation
features for default values in oslo_config, the CORS middleware
has been placed in the odd position where its configuration behaves
inconsistently. If you configure via add_origin, then defaults set
in set_defaults are not honored. If you configure via multiple
configuration blocks ([cors.foo]), then the defaults are also not
honored.

Additionally, with the conversion of allowed_origin into a list_opt,
there is less direct need for multiple config-block parsing.

In order to ensure that the middleware behaves consistently with
the rest of oslo, as well as adheres to a set of basic sane assumptions
made by consumers, this patch deprecates the code path that searches
oslo's configuration for multiple [cors.*] blocks. Subsequent patches
will add additional deprecation flags to this end.

Change-Id: I49c15ccc2dce03b0dea33ec45ef6e271e58582da
2016-05-09 07:18:21 -07:00
Michael Krotscheck e9c3a23e84
Deprecated set_latent
With the introduction of set_defaults, as well as new documentation
features for default values in oslo_config, the CORS middleware
has been placed in the odd position where its configuration behaves
inconsistently. A user may use set_defaults to set persisted default
values that may be overridden, or they may use set_latent to add values
that will be applied to every request. As both of these serve essentially
the same function, and the latter is only necessary if it is feasible to
configure multiple allowed_origins with different CORS properties.

With the depecation of multiple configuration blocks, it is no longer
necessary to maintain this feature. Therefore, this patch adds the necessary
deprecation flags, and removes it from the documentation.

Change-Id: Icd44684b3d05ff6a07665348c08adff8245f2523
2016-05-05 05:03:34 -07:00
Michael Krotscheck ea167241d4
Removed simple headers from documentation examples
These headers were removed from the defaults in
https://review.openstack.org/#/c/293566/ - as they are already
automatically managed in accordance to the CORS specification. This
patch removes them from the example code.

Change-Id: Ic2728d65c31dcd2f6a887ce8b112f544fd5730f3
2016-05-04 10:25:57 -07:00
Doug Hellmann 67bf9d274c Revert "work around doc build error"
This reverts commit bb8dbeb3a3.

Making this work will depend on having a new release of oslo.config with
the fix in the dependent patch.

Depends-On: Ia024722d05ce8adaa57c58559cb42f2913653bb9
Change-Id: I33b37c74abf63bcaa95e668ec74c9c9849cc3773
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-24 12:22:59 -05:00
Doug Hellmann bb8dbeb3a3 work around doc build error
This patch addresses a documentation build issue caused by the
oslo.config sphinx integration. In order to unblock this repo, we can
work around the issue here while fixing it in oslo.config, then revert
this change.

Change-Id: Ie4a29e8e8d44d00354ea0dd8420bac5b8812a717
Related-Bug: #1549106
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-24 12:11:39 -05:00
Michael Krotscheck c4957606cb Switched StrOpt to ListOpt in CORS allowed_origins
This patch switches the 'allowed_origin' CORS configuration option
from a single string to an array of strings. This will let you
configure multiple domains simultaneously with the same options,
without having to add additional configuration blocks.

By doing this, pastedeploy users will no longer have to configure
mulitple filters if they wish to grant access to more than one
domain.

Change-Id: Ie2e57b76717604f701daa16ebf8ffa8c06835e3c
2015-11-16 18:07:15 -08:00
Michael Krotscheck 4e7bb27895 Enable latent CORS configuration via pastedeploy
In the case where paste deployment and oslo are used in concert,
it is not possible for an application to easily ship required
configuraton properties, such as custom headers, with their
release artifact. This patch adds parameters which expose
set_latent to paste.ini users, permitting the above.

Tests and documentation have been updated.

Change-Id: Id98002f6813055efe698f0b96a3e0d408c58ed7c
2015-11-16 17:26:51 -08:00
Michael Krotscheck 7404a37e70 Add oslo_config program support to paste middleware
oslo_config's configfile autodiscovery permits an additional parameter
named 'prog', which will add an additional file name to the possible
files that are checked in oslo_config directories. This patch adds this
parameter to paste-ini initialization, permitting access to more
configuration files.

This feature is required by glance, as glance does not make use of
./glance/glance.conf. Instead, they use ./glance/glance-api.conf. The
appropriate middleware configuration in this case would then be:

oslo_config_project=glance
oslog_config_program=glance-api

Change-Id: Ie530e4fac8076dc46b705770d12940ef91cb4644
2015-11-13 15:00:48 -08:00
Jenkins 83768a6c79 Merge "Include changelog/history in docs" 2015-09-25 11:03:15 +00:00
Joshua Harlow 449089af6f Include changelog/history in docs
Change-Id: I5b2a3002d91ed9b6634d8a43c80e896fd66628d3
2015-09-24 14:15:41 -07:00
Craige McWhirter 907105d331 Add plugin doco generated with stevedore.sphinxext
As per:
http://lists.openstack.org/pipermail/openstack-dev/2015-August/073338.html

The point behind the addition of the stevedore.sphinxext extension is
"to document drivers and other types of plugins to make the available
sets built into projects easier to discover" (dhellman).

Change-Id: If24f70704dd4840c44e6e72928157078fea80b51
2015-09-18 15:35:45 +10:00
Doug Hellmann ea893e8ba4 Split option discovery function by middleware
Create separate option discovery functions for each piece of middleware,
so an application that only uses one piece can include only those
options in its sample configuration file.

Test the results with some unit tests that simply ensure the functions
do not raise exceptions, and by adding configuration options to the
documentation for the library, using the new integration of oslo.config
with sphinx.

Change-Id: I4c777cd70c063441f430c48ab1f9c9cac2c1fc75
2015-08-27 06:06:44 -04:00
Michael Krotscheck 3fbb59574c Added latent properties to CORS middleware.
Latent properties allow a consumer of this middleware to declare
system-required headers and methods options. For instance, if an
API exposes version-negotiation headers, these may be hard coded
when the middleware is attached.

This only works when the middleware is explicitly used. It does
not work in paste configuration.

Change-Id: Ic55b1af23603a0d83a32d20054c18e50367be8fb
2015-08-12 09:57:54 -07:00
Mehdi Abaakouk 41ac7aeec2 Allow to get option from paste-deploy
This change allows any middleware that use oslo.config to
be configured via paste-deploy, like the cors does.

Related-bug: #1482086
Change-Id: Ibb3e951b45b51c9bc602c9113df18a58226d92d1
2015-08-07 08:23:35 +02:00
Michael Krotscheck 655de16a87 Support PasteDeploy
This patch removes the oslo_config specific code out of the
middleware's class, and instead provides a factory method by which
this middleware may be constructed. It then also provides a similar
factory method that supports pastedeploy's filter_factory protocol.

Change-Id: I68d9c5439707a624aa24f3dbe7bbfd616b382a6d
2015-06-30 09:01:48 -07:00
Michael Krotscheck cab38ce307 Added CORS wildcard handling
The CORS specification permits the declaration of '*' as a response
wildcard domain, which explicitly allows _all_ domains to break
the single-origin policy. While we DO NOT recommend this method,
the ability to set a global policy should be included for the
sake of completeness.

Change-Id: Ifcc65ca74fa976dbd322a7ffd4ffba5443d1df5b
2015-05-26 09:33:18 -07:00
Michael Krotscheck 027dd345f3 Add CORS Middleware for Oslo.
This aims to provide a comprehensive middleware solution
for the CORS (Cross-Origin-Resource-Sharing) specification -
http://www.w3.org/TR/cors/.

Tests and documentation have been provided.

Change-Id: I3c0ff620f10bec2cbf7b748d48fff025aab44351
2015-04-08 18:28:13 -07:00
Mehdi Abaakouk 3687523a65 Fixes the healthcheck factory method and docs
This change fix the factory method of the healthcheck middleware

It also adds documentation about how to configure the middleware

Change-Id: Ie549d4686e921a9d407ba2829f69f92216bfcf9a
2015-01-26 14:25:27 +01:00
Doug Hellmann 8e06ca5bd0 Move files out of the namespace package
Move the public API out of oslo.middleware to oslo_middleware. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Change-Id: If88c65c82b64f096a02f7ec62e019aea4de2f9d3
2015-01-06 13:44:01 -05:00
Doug Hellmann b6c4489960 Update docs for first release
Ensure each exported class has a docstring.

Add API to the sphinx docs.

Fix a few formatting issues so the rendered docs look OK.

Change-Id: Ieef7bae3783a084249169fe9b80ab17518eee15f
2014-08-26 17:33:01 -04:00
Christian Berendt 2fdcb5b383 Cleaning up index.rst file
Removed notes about the generation of the file and fixed the syntax.
2014-07-22 15:55:17 +02:00
Gordon Chung 5abab9ed08 exported from oslo-incubator by graduate.sh 2014-06-24 16:49:39 -04:00