Removed E125 (continuation line does not distinguish itself
from next logical line) from the ignore list and fixed all
the indentation issues. Didn't think it was going to be
close to 100 files when I started.
Change-Id: I0a6f5efec4b7d8d3632dd9dbb43e0ab58af9dff3
The functionality within neutron.db.common_db_mixin is available via
neutron-lib APIs. This patch removes common_db_mixin and updates any
uses of it to use neutron-lib instead.
Depends-On: https://review.openstack.org/#/c/636159/
NeutronLibImpact
Change-Id: I2388f90b37abb09408809dda8c21da551bcd94bb
Reduces E128 warnings by ~260 to just ~900,
no way we're getting rid of all of them at once (or ever).
Files under neutron/tests still have a ton of E128 warnings.
Change-Id: I9137150ccf129bf443e33428267cd4bc9c323b54
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
The functionality from model_query is already in neutron-lib and
consumers are using it. This patch removes the _model_query module
from neutron and updates all imports to use neutron-lib's version of
it instead.
NeutronLibImpact
Change-Id: Ib2eae9edb009a93e60b3b0d63ca365056138566b
The _resource_extend module is already rehomed into neutron-lib and is
shimmed in neutron. This patch removes the module as no active
consumers are using it.
NeutronLibImpact
Change-Id: I1550075fa5fa2aa2f1a88ee7189d311a1fe78391
The neutron.db.api.context_manager already references neutron-lib's
context manager; so consumers of it are already using neutron-lib. This
patch switches neutron's references to the context_manager over to
use neutron-lib's directly rather than that in neutron.db.api.
NeutronLibImpact
Change-Id: I97120faeec73690592ed21a5ec3c6202f61e1429
The retry_if_session_inactive decorator was rehomed into neutron-lib
[1]. This patch consumes it by removing the function from neutron and
using neutron-libs version where appropriate.
NeutronLibImpact
[1] https://review.openstack.org/#/c/557040/
Change-Id: I3e3289f33e62d45933d0fbf165bb4b25078f22d5
This patch removes neutron/db/tag_db.py and moves the relevant code to
neutron/objects/tag.py.
Change-Id: I147debf7f7c8388140b160cd835dbd4a95fee784
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Enforce validation on filter parameters on list requests.
If an API request contains an unknown or unsupported parameter,
the server will return a 400 response instead of silently ignoring
the invalid input.
In resource attributes map, all filter parameters are annotated by
the ``is_filter`` keyword. Attributes with is_filter set to True
are candidates for validation.
Enabling filter validation requires support from core plugin and
all service plugins so each plugin need to indicate if it supports
the validation by setting ``__filter_validation_support`` to True.
If this field is not set, the default is False and validation is
turned off. Right now, the ML2 plugin and all the in-tree service
plugin support filter validation. Out-of-tree plugins will have
filter validation disabled by default.
An API extension is introduced to allow API users to discover this
new API behavior. This feature can be disabled by cloud operators
if they choose to do that. If it is disabled, the extension won't
be presented.
Depends-On: Ic3ab5b3ffdc378d570678b9c967cb42b0c7a8a9b
Depends-On: I4397df1c35463a8b532afdc9c5d28b37224a37b4
Depends-On: I3f2e6e861adaeef81a1a5819a57b28f5c6281d80
Depends-On: I1189bc9a50308df5c7e18c329f3a1262c90b9e12
Depends-On: I057cd917628c77dd20c0ff7747936c3fec7b4844
Depends-On: I0b24a304cc3466a2c05426cdbb6f9d99f1797edd
Change-Id: I21bf8a752813802822fd9966dda6ab3b6c4abfdc
Partial-Bug: #1749820
The tag and tag_ext extensions are deprecated for removal, but are not
used widely today [1]. Rather than rehoming these extensions to
neutron-lib and carrying out their deprecation life-cycle for no
apparent reason, this patch proposes we just remove them now.
While [2] initially removed these extensions, we had to revert
them with [3].
Depends-On: I295a5b84eb7fa3439561fa009b7499f94d8df4d2
[1] http://codesearch.openstack.org/?q=from%20neutron.extensions%20import%20(tag_ext%7Ctag)
[2] I0d7bcd789b468b1dd3f7ea13e6751a46203d6778
[3] If16443616eee703b66d57b6422dd451a443fbc64
Change-Id: I97095453610fff114d999a526d67e78119546ff5
It looks this patch breaks Zun's gate. The reason might be
that Zun depends on Kuryr-libnetwork which still use the
legacy tag extension. I propose to revert this for now and
give the kuryr team some time to migrate to the new extension.
This reverts commit 38148d1752.
Change-Id: If16443616eee703b66d57b6422dd451a443fbc64
The tag and tag_ext extensions are deprecated for removal, but are not
used today [1]. Rather than rehoming these extensions to neutron-lib and
carrying out their deprecation life-cycle for no apparent reason, this
patch proposes we just remove them now.
[1] http://codesearch.openstack.org/?q=from%20neutron.extensions%20import%20(tag_ext%7Ctag)
Change-Id: I0d7bcd789b468b1dd3f7ea13e6751a46203d6778
neutron-lib contains the OVO exception module. This patch switches all
such reference's over to lib's version of the module and removes it
from neutron.
Change-Id: Ic3d435eef51f970598bf50486894838498b2d438
Note: We don't currently have any out-of-tree consumers of this module.
Tag mechanism supports network, subnet, port, subnetpool
router resources only. This patch allow tag mechanism to support
resources with standard attribute.
Two old extenions are kept because of backward compatibility.
They will be removed in Queens release.
APIImpact: Tag is supported by resources with standard attribute
DocImpact: allow users to set tags on resources with standard attribute
Change-Id: Id7bb13b5beb58c313eea94ca03835d3daf5c94bc
Closes-Bug: #1682775
neutron-lib now contains the API definitions for neutron's core
resources. This patch removes the constant core resource and collection
variables and uses them from lib. Subsequent patches will consume the
actual core resource attribute definitions.
NeutronLibImpact
Change-Id: Ia9afdf620cd538b2aa420593277d6403a45c996b
Now that CommonDbMixin is just a shim we can stop using it.
Instead, use the model_query and resource_extend functions directly.
Related-Blueprint: neutron-lib
Change-Id: If1252c42c49cd59dba7ec7c02c9b887fdc169f51
By registering functions directly we cut off the dependency of the
"resource extend" functions on the plugin. This is a step towards
the goal of removing the CommonDbMixin mixin class.
Also, we register all "resource extend" functions at plugin create
(in __new__) instead of in the class definition (which caused the
hooks to be registered on import). This ensures the "resource
extend" functions are only registered for the plugins/mixins that
are actually used.
Note that decorators are used to register "resource extend" methods,
similar to the callback receiver decorators.
Related-Blueprint: neutron-lib
Change-Id: I128cfda773d5f9597df9cd61261fdc05f2a174aa
By registering functions directly we cut off the dependency of the
query hooks on the plugin. This is a step towards the goal of
removing the CommonDbMixin mixin class.
Also, we register all query hooks at plugin create (in __new__)
instead of in the class definition (which caused the hooks to be
registered on import). This ensures the query hooks are only
registered for the plugins/mixins that are actually used.
Since the query hooks are decoupled from the plugin, we remove them
from the extension mixins (make them global in their module). This is
a step towards refactoring all extension mixins for removal.
Extra: In this patch we also remove the CommonDbMixinHooksFixture test
fixture and instead just clear out the hooks after each test.
Related-Blueprint: neutron-lib
Change-Id: Ib6c2134d29e1764de627c3355f6cdee789d6301e
This replaces wrap_db_retry with
neutron.db.api.retry_if_session_inactive() in the tags
plugin.
wrap_db_retry is missing a bunch of exception types we
can encounter and are expected to retry in normal database
operations in Neutron (e.g. staledataerror in the bug report).
This patch doesn't include a unit test because there is already
quite a bit of coverage ensuring the decorator handles these types
of exceptions.
Closes-Bug: #1673243
Change-Id: I65b10ee54301401cd4525152a82a604ac8744582
There was a bug in I0179a3616689f39d93c337c730283e21a01677cf that made
the service plugin to clean up removed tags from all resources, not just
the one requested.
Change-Id: Ifbe13102ebd903e01eb28a00d97e7e94d1a0e0b1
Closes-Bug: #1673086
Move the model query hook registration and resource extend funcs
registration methods out of the CommonDbMixin class and make them
regular utility functions.
This is a step in refactoring the CommonDbMixin class.
Change-Id: Iec1bb7f7098c83640ae695fd7cf2f4736f414ad2
This patch introduces and integrates Oslo-Versioned Object for
Tag Model class.
Change-Id: I0179a3616689f39d93c337c730283e21a01677cf
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
This patch enhances the tag mechanism for subnet, port, subnetpool,
router resources. The tag-ext as new extension is added so that
tag supports their resources.
APIImpact: Adds tag support to subnet, port, subnetpool, router
DocImpact: allow users to set tags on some resources
Change-Id: I3ab8c2f47f283bee7219f39f20b07361b8e0c5f1
Closes-Bug: #1661608
This will prevent the common_db_mixin dictionary
extension functions and query hooks from stopping
the GC of plugins in tests and causing resource leaks.
Change-Id: I7576851a44abd14cbc337a3d3e28690c7316ec81
This updates the tag to bump the revision of the standard
attr record it's associated with. This required a small change
to include a bump revision method directly on the standard
attr records.
Closes-Bug: #1643879
Change-Id: Ia096cd342ed3eeec33a8ae64efe13d469c375dd6
Use reader and writer for db operations with tags.
Partially-Implements blueprint: enginefacade-switch
Change-Id: I64b72c9ea7f8594e7958f5a521d7283376a368da
Introduce a generic mechanism to allow the user to get
Neutron resources with tag filter.
APIImpact
Change-Id: I1e5b25fea268e188cc9620c72b3c71004b197512
Partial-Implements: blueprint add-tags-to-core-resources
Related-Bug: #1489291
Introduce a generic mechanism to allow the user to set tags
on Neutron resources. This patch adds the function for "network"
resource with tags.
APIImpact
DocImpact: allow users to set tags on network resources
Partial-Implements: blueprint add-tags-to-core-resources
Related-Bug: #1489291
Change-Id: I4d9e80d2c46d07fc22de8015eac4bd3dacf4c03a