Commit Graph

98 Commits

Author SHA1 Message Date
Takashi Kajinami 3fd431a188 Update URL for flake8 from Gitlab to Github
It seems flake8 project has been migrated from Gitlab and Github and it
is no longer available in Gitlab. This change updates the URL in
the doc to direct readers to the new repository.

Change-Id: Ia9e8429e8d32a181a47aee43ebde5378c6ac9cf0
2022-11-16 11:16:41 +09:00
shanyunfan33 64b2f2bde0 remove unicode from code
remove unicode from code

Change-Id: Iee0bca6009d0cd9edb66fc787bf8452ba9de253d
2022-01-19 09:15:45 +08:00
Slawek Kaplonski e1534b64cf [Doc] Update callbacks guide
With patch [1] we removed old, deprecated method registry.notify().
This patch updates callbacks documentation accordingly.

[1] https://review.opendev.org/c/openstack/neutron-lib/+/807869

Change-Id: If608eed8c28b6d96ef55ebe9c6dda27dd748107f
2021-10-09 17:53:19 +02:00
Zuul 23968919cd Merge "Correct wrong name of APIEventPayload's arg" 2021-04-19 11:14:09 +00:00
ericxiett 51e6745375 Fix outdated output
The outputs example in section 'Subscribing to events' is outdated
 that is not the result of the above code. Also the mothod name
 of 'callbackhighproirity' is a typo.

Change-Id: I0c27777d007cfb6588d315b8a59f0db2a043cc1d
2021-04-19 00:49:48 +00:00
ericxiett 287e65ee09 Correct wrong name of APIEventPayload's arg
In latest version, use 'method_name' instead of 'notifier_method'.
This patch modifies it.

Change-Id: If6a2852b6a825ce7263260b79237effc9a837dd2
2021-04-17 08:41:37 +00:00
Nate Johnston 4f17bc10ba Change policy on neutron-lib migration
Per the results of discussion at the Virtual PTG in June 2020, we are
changing our policy with regards to neutron-lib code forklifts.  We are
signaling that the mass migration of code from neutron to neutron-lib
will no longer be actively pursued, and simplifying the process for such
migrations - should they become necessary - by using debtcollector
removals.

Change-Id: I5669caf7e579c066acc52887a7f31ee8e238093f
2020-07-10 14:22:17 -04:00
Andreas Jaeger 0836afb94b Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 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.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Set openstackdocs_auto_name to use 'project' as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

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.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I477de339e7a2851311a712ff28689ad354ef0229
2020-05-21 10:22:57 +02:00
Zuul 37deb26639 Merge "Switch to hacking 2.0" 2020-03-17 17:10:41 +00:00
Akihiro Motoki f4f5f1c719 Switch to hacking 2.0
In hacking 2.0, local-check-factory was removed as it is not compatible
with flake8 3.x and it is advised to use flake8's local plugins [1].
Checks specific to neutron-lib registered via local-check-factory are
converted into flake8's local plugins [2].

Note that neutron_lib.hacking.checks.factory is kept not to break hacking
checks in neutron-lib consumers. They need to be converted into the style
in hacking 2.x in each repository and then we can drop the factory here.

[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-2-0-0
[2] https://flake8.pycqa.org/en/3.7.0/user/configuration.html#using-local-plugins

Change-Id: I90419fe0b385e7bee216a52c1169aba6d6975d56
2020-03-17 15:31:31 +09:00
Rodolfo Alonso Hernandez 1da279b3ad Use "unittest.mock" library and drop "mock" installation
As commented in [1], "unittest.mock" has been supported in the Python
internal unit testing framework since version 3.3.

[1]http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html

Change-Id: If71241a412ecfe3471a472802e18c986bd05d5b1
2020-03-13 12:10:36 +00:00
Rodolfo Alonso Hernandez 478502b3df Remove library "six"
Now Python2 is not supported, this compatibility library for both
versions is not needed anymore.

Change-Id: Ic6da328a6219c8a00d38602f6b539a2ff5be1b2e
2020-01-22 13:16:45 +00:00
Michael Johnson 06ae464a4d Remove Neutron LBaaS
Neutron-LBaaS has now been retired and there will be no Train
release[1]. This patch removes the neutron-lbaas API reference and
various other references to Neutron-LBaaS from neutron-lib.

[1] https://review.opendev.org/658494

Depends-On: https://review.opendev.org/665838
Related-Bug: #1833125
Change-Id: I0200abba2bca07a610839ba4fa8e2d9f2fa82218
2019-09-13 16:08:08 +00:00
Akihiro Motoki 2f08f1203b PDF documentation build
Change-Id: Ic4d3fe2f5feef6e78b84831683f1826af16eec9e
Story: 2006099
Task: 35132
2019-09-04 13:12:33 +00:00
Andreas Jaeger 60ca196817 Update api-ref location / version
The api-ref now lives on docs.openstack.org, update links to it.

Also, remove version number from published document.

Change-Id: I173973d8c62d2d0169697aa3329c36de3b2d5a41
2019-07-22 16:36:32 +02:00
Boden R 2f9c9699e5 fix doc periodic log url
In the releasing doc for neutron-lib, the URL to the periodic logs is
wrong as it still points to git.openstack.org URLs. This patch changes
the URL to opendev.org

Change-Id: I1d70c7cf213d8c603aab0ecb12df8d38f875e0d1
2019-05-29 08:45:38 -06:00
zhangboye 5b6a27d80f Cap sphinx for py2 to match global requirements
Change-Id: I3e6c1982b675356858624b50e18571ce6b0f1fe9
2019-05-16 16:06:38 +08:00
ZhongShengping d825414677 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: I18b8181e29b1d81245df3534e75f13bde3c80ef3
2019-04-22 11:23:33 +08:00
Boden R ea53b0ecd1 remove use of legacy modules
The notion of legacy modules has been in neutron-lib from the start and
the intention was to place them under neutron_lib.legacy.*
However we've been working on neutron-lib for a few years now and have
never used legacy modules. IMO it's safe to assume we won't use them
in neutron-lib.

This patch removes the empty sub-package neutron_lib.legacy and removes
the discussion of them from the docs.

Change-Id: Ie7a4cf65e37c3f2dcd3446232dba9695f41e314d
2019-04-10 10:47:02 -06:00
Boden R c0f55acf70 doc neutron-lib current
This patch updates the docs to explain the use of neutron-lib-current
[1] and consumption in general.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-September/135063.html

Change-Id: I2e0dfb6ad34b1060c22945d01e22c589d42e27c7
2019-01-24 06:19:39 -07:00
ZhongShengping 6646e33326 Update devel info: mailing list
The new openstack-discuss mailing list is going to replace few
mailing lists, including openstack-dev.

Change-Id: Ib7280a890fc49ff9ab73cc92aaa70283a8ff7b61
2018-12-05 08:56:19 +08:00
Boden R a37d43018b rehome rpc and related plumbing
As shown in the history of this patch, along with the work in [1], we've
discussed rehoming neutron.common.rpc into lib a number of times before.
One of the main reasons we've decided not to rehome in the past is that
we'd hoped the neutron.common.rcp.BackingOffClient and related plumbing
could be put into oslo.messaging. However, it's 2 years later and that
still hasn't happened [2][3].

This patch proposes we just move forward with the rehome so that we can
begin to untangle the consumers [4]. There's no reason we can't
reiterate on this code in lib; it's no more difficult than in neutron.

This patch includes rehoming of:
- neutron.common.rpc, the only difference in the lib version is that
we dynamically add all neutron_lib.exceptions by default (_DFT_EXMODS).
- neutron.common.exceptions, but exceptions are broken out into their
respective exception modules rather than lumping all together in a
generic single module.
- The fake notifier and RPC fixture, without any real changes.
- A new runtime util method to dynamically load all modules for a
package.

For a sample neutron consumption patch see [5] that was tested with
PS10 herein.

[1] https://review.openstack.org/#/q/project:openstack/neutron-lib+message:rpc
[2] https://review.openstack.org/#/c/407722/
[3] https://bugs.launchpad.net/oslo.messaging/+bug/1667445
[4] http://codesearch.openstack.org/?q=from%20neutron.common%20import%20rpc
[5] https://review.openstack.org/#/c/579989/

Change-Id: I0052ba65973a993e088943056879bc6e982bd0b5
2018-07-12 13:13:21 -06:00
Zuul 48b09a44bb Merge "Trivial: Update pypi url to new url" 2018-05-14 08:05:49 +00:00
Zuul e19f408520 Merge "Add documentation for callback priority" 2018-05-04 23:34:00 +00:00
Manjeet Singh Bhatia 67fc6653db Add documentation for callback priority
As [1]. introduced priorties for execution of callbacks,
this patch adds some information about priority group
that can be used to maintain for order of callback executions
for different events of a resource.

1]. https://review.openstack.org/#/c/541766

Change-Id: I2da39c4f895e25924de46e8eca85e1cc67c4d0f3
2018-04-25 15:00:56 -07:00
Zuul 4cd1d65a22 Merge "fix docs/links for 1.14.0 release" 2018-04-24 16:39:10 +00:00
Zuul 180d0794be Merge "rehome model_query and its dependencies" 2018-04-24 10:20:18 +00:00
Boden R 2dc98bf4af fix docs/links for 1.14.0 release
This patch addresses the following issues in prep for the neutron-lib
1.14.0 release:
- Updates the tox linkcheck target to get it working.
- Removes the glob for modules/* in doc/source/reference/index.rst as
this causes local build errors when not finding anything with the glob.
- Fixes any issues found by running the linkcheck tox target.

Change-Id: I0e96068cd7b6733adc35503b40500b80692cfd6d
2018-04-23 11:24:08 -06:00
melissaml 5693e90f9b Trivial: Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: I2051d173f99cbccc9386ce76ad6c1c8317377e4b
2018-04-21 09:11:08 +08:00
Boden R 108a598252 rehome model_query and its dependencies
This patch rehomes neutron.db._model_query into neutron-lib. While
our longer term goal is to use OVO rather than queries and tables, this
module is provided as a stepping stone (as mentioned in release note
herein). The patch also includes a few other APIs that are required for
the rehome including some utils and an exception class.

For more details see the spec on [1].

Also a sample consumption patch can be found on [2]. While it won't work
as-is with the depends on approach (it needs to be rebased on multiple
other DNMs in neutron) I tested it locally. In addition this change
was tested locally with a sample vmware-nsx consumption patch [3].

[1] https://review.openstack.org/#/c/473531/
[2] https://review.openstack.org/#/c/557786/
[3] https://review.openstack.org/#/c/557788/

Change-Id: I3e4b38aa3b6460ce916091c020adedd4ed2c4d26
2018-04-20 06:18:11 -06:00
Thomas Morin c8e1389a55 API attribute processing: allow to populate dict attribute default values
Currently, the neutron-lib API code fills defaults values for the
attributes defined in a resource map, but does not fill defaults inside
the attributes that are dictionaries.

This change introduces a 'dict_populate_defaults' flag that allows the
defaults to be filled inside dictionary attributes (attributes of any
dictionary type).

This is useful to incorporate networking-sfc APIs and avoid using
the specific normalize_* converter methods [1] (see follow-up changes).

[1] https://github.com/openstack/networking-sfc/blob/master/networking_sfc/extensions/sfc.py#L226-L239

Change-Id: I0d7ff1981aa92d17811233e29a6ca7264a9ddb6c
2018-04-17 17:25:31 +02:00
Thomas Morin 478c4d85b0 API attribute processing: add 'default_overrides_none'
This change introduces an 'default_overrides_none' flag.

When enabled, the default value for the attribute will
be used, including if the attribute was explicitly defined
as None.

This is introduced to support the current behavior of the
flowclassifier API extension from networking-sfc
(see Id5aea04553b78dd17fca85de88cf076b42d24140).

Change-Id: I511d7dfd02ceed417d377451ec0265d9704ef261
2018-04-17 17:25:30 +02:00
Zuul 7c4e74a490 Merge "Annotate network parameters for sort_key" 2018-04-16 18:22:38 +00:00
Zuul d2c6567e8a Merge "Annotate all the filter parameters for networks" 2018-04-11 23:37:17 +00:00
Hongbin Lu b03226d597 Annotate network parameters for sort_key
Add a 'is_sort_key' keyword for each network's attribute that can
be used as a sort_key. In the future, we will rely on this keyword
to perform validation: https://review.openstack.org/#/c/554368/ .

Change-Id: I6104a1b534a7ddc4856bd1a25d77e12b1ed5421f
Related-Bug: #1749820
2018-04-09 17:04:50 +00:00
Hongbin Lu 0abe67c6eb Annotate all the filter parameters for networks
Add a 'is_filter' keyword for each network's attribute that can be
used as filter. In the future, we will rely on this to perform
filter validation: https://review.openstack.org/#/c/554368/ .

Change-Id: I0cdc1ff482d4ff7ec6afa391392c27c2c099cc0e
Related-Bug: #1749820
2018-04-09 17:01:20 +00:00
Zuul 5627a2391a Merge "Follow the new PTI for document build" 2018-04-06 18:25:32 +00:00
Boden R 36bb16b941 ut updates for extending sub-resources
When extending an existing sub-resource definition, the
SUB_RESOURCE_ATTRIBUTE_MAP must define the extended resources/attributes
under the 'parameters' object. This instructs the API internals to
update the existing sub-resource's attribute map rather than just
overwrite it. For internals see the logic in the extend_resources()
method in neutron.api.extensions [1]. For example the
qos_bw_limit_direction in neutron uses this approach for its
BANDWIDTH_LIMIT_RULES definition (also see related lib commit
I823f567ddf9c895eb3cf94e95ae34a382d67f51d).

This patch adds that support to the base api def test case and also
updates the contributor internals to document such. No release note
included since nothing changed from a consumption perspective.

[1] https://github.com/openstack/neutron/blob/master/neutron/api/extensions.py#L350

Change-Id: Ib91004490dc3ca71b7caafe5cc3cb07417be1e4c
2018-04-04 13:34:55 -06:00
melissaml bc16522329 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: I2f6d52e61fe9a036a6565883626673d37cd89070
2018-03-27 11:19:28 +08:00
Boden R 0996b3fc02 update releasing doc links for zuul v3
As part of the migration to zuul v3, a few of the links have changed.
In particular:
- The periodic job failure rate in grafana is now panel 6, not 4.
- The periodic logs are no longer in a single location and thus
can't be referenced with a single link.

This patch fixes up those issues.

Change-Id: Ifb60cebab4b9a2e61a15f21f9cb4fc13d52975ee
2018-01-02 13:33:21 -07:00
Zuul 223b60be41 Merge "docs: Subscribing events using registry decorator" 2017-11-23 02:39:16 +00:00
Dongcan Ye bf69a299dd docs: Subscribing events using registry decorator
We supports using registry decorators to subscribe events, this
patch add it in our guide.

TrivialFix

Change-Id: Iaf3a6712aecd063b8cc272b31e374af35347c03f
2017-11-07 21:47:42 +08:00
Dongcan Ye dc8c3f7587 docs: Add primary_key attribute key
While reading the contributor guide, it seems lack of description
of primary_key. [1]

[1] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/definitions/base.py

TrivialFix

Change-Id: I3896644ec1cd395050834416ab74f00620acbcbe
2017-11-02 19:00:34 +08:00
Jenkins 48af3fb453 Merge "add api ref and doc link validation to release" 2017-10-05 02:12:11 +00:00
Boden R 9a7ee91e4a fix doc links
This patch fixes some doc links that were found when testing commit
I48b4dde3ffd1902a31bf6f352b7143d4c15f3443.

Change-Id: I9b71868940c8480bc593037341cc859f50b83a9a
2017-09-21 15:22:03 -06:00
Boden R b4ec3d0ebd add api ref and doc link validation to release
This patch adds a linkcheck target to our tox.ini that validates URLs
in both our doc and api-ref html. In addition the release checklist is
updated to suggest this should be done prior to releasing.

Partial-Bug: #1716005

Change-Id: I48b4dde3ffd1902a31bf6f352b7143d4c15f3443
2017-09-21 15:20:10 -06:00
Monty Taylor d01e189c1d
Remove vestigate HUDSON_PUBLISH_DOCS reference
This isn't actually used and is a leftover from a thing we did
seven years ago that survives today through copy-pasta.

Change-Id: Ia05b11a59b2bca8caa7c64c3d2c9fe7e8552f519
2017-09-02 08:54:17 -05:00
Akihiro Motoki 90a8302231 Update the documentation link for doc migration
Change-Id: I7db258cc50373c5011b8f99b6f8971a08ca336f3
2017-07-20 15:46:41 +00:00
Akihiro Motoki f9b06e8937 Enable module reference
Also fixes sphinx warnings in existing docstrings.

Change-Id: Iccccd782ff8b80a3fd2764e7ef9cc3dde46e32ee
2017-07-05 12:09:10 +09:00
Akihiro Motoki b9f62ba6a3 rearrange content to fit the new standard layout
Part of doc-migration work

The proposed document strucutre is documented at:
http://specs.openstack.org/openstack/docs-specs/specs/pike/os-manuals-migration.html

Change-Id: Idea4f21bb66fbdf4b4f8925f2260f43374a108f3
2017-07-05 08:55:21 +09:00