Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/api.
Trivialfix
Change-Id: I1258b04f64a18036407e1d9de9ddca7472af0d11
All of the externally consumed variables from neutron.common.constants
now live in neutron-lib. This patch removes neutron.common.constants
and switches all uses over to lib.
NeutronLibImpact
Depends-On: https://review.openstack.org/#/c/647836/
Change-Id: I3c2f28ecd18996a1cee1ae3af399166defe9da87
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 neutron.common.rpc module has been in neutron-lib for awhile now and
neutron is shimmed to use neutron-lib already.
This patch removes neutron.common.rpc and switches the code over to use
neutron-lib's implementation where needed.
NeutronLibImpact
Change-Id: I733f07a8c4a2af071b3467bd710290eee11a4f4c
The neutron.common.topics module was rehomed into neutron-lib with
commit Ie88b84949cbd55a4e7ad06341aab77b286cdc485
This patch consumes it by removing the rehomed module from neutron
and using the module from neutron-lib instead.
NeutronLibImpact
Change-Id: Ia4a4604c259ce862597de80c6deeb3d408bf0e95
We already log the full object on the agent side
and other server methods log important parts of
the object so there isn't much to gain logging the full
OVO components passed to this function's args.
This adds a specific debug statement that just indicates
the types, IDs, and revision_numbers being pushed out so
they can still be correlated with received objects on the
agent side.
Partial-Bug: #1707307
Change-Id: I4499bb328f0aeb58fe583b83fb42cd2d26c1c4c1
This code was needed for some Mitaka to Newton upgrade scenarios, but we
are now in Ocata to Pike, so killing the code is overdue.
Change-Id: Ida3fc4ce2d18c50e603b2b71dfb8f884845bf78a
Add an RPC interface to retrieve many OVO resources
at once based on filters.
Partially-Implements: blueprint push-notifications
Change-Id: I5e765712ab8b8065d71653c563f004c7a9ce9021
Maintaining the context is important for keeping the request ID
and subsequently operator/developer sanity while debugging.
The resource_type is also helpful to have since a function could be
subscribed for multiple resources.
This maintains and deprecates the existing 'subscribe' method for
backwards compatibility with callbacks that don't support receiving
the context and resource type. A new 'register' method is added
for callbacks to use that are compatible with receiving the context.
Change-Id: I06c8302951c99039b532acd9f2a68d5b989fdab5
This is expected when the server is pushing for a resource
and some listeners (like the OVS agent) are not interested
in the event. This happens when Trunk create/delete events
are dispatched by the server.
Change-Id: I90ddffda546af45ca85b3e4f4f22eed005d971df
Closes-bug: #1625872
This is expected when the agents are asking for a resource
that might not exist if a server side service plugin is
not loaded (e.g. Trunks). The Linux Bridge implementation
currently checks if each new port is a trunk so this results
in a bunch of log noise on the server without this patch.
Partially-Implements: blueprint vlan-aware-vms
Change-Id: I503fe51b0b537003a547af6e07304b29a53cde42
There are usage patterns which would benefit from having
the capability to send a list of resources in bulk instead
of using individual fanout messages.
From now on, the rpc callback subscriber receives a list of
resources (single or multiple), and the pushers must always
push a list.
Backwards compatibility for QoSPolicy consumers in mitaka
is provided by calling push with "resource" parameter for
single item lists during one release cycle. That will be
dropped when Ocata opens.
Partially-implements: blueprint vlan-aware-vms
Change-Id: I1117925360a29ecbd1902fa527b2f24f94ce81ec
This is the second patch to allow upgrades on RPC versioned
objects callbacks.
This enables resource version notifications from agents to all
neutron servers via fanout for updating the version sets in
memory, and via agent status updates for DB storage, so any
neutron server can retrieve such information at boot.
Closes-Bug: #1535247
Change-Id: I67c1323267aaf7e49f4a359ff50b94e52dba4380
Introduces a version manager in the callbacks rpc, which tracks
the agents' known resource versions across the distributed system,
making rpc callback push notifications smart about which resource
versions need to be serialized and sent over the wire during a
cloud upgrade process.
Subsequent patches will implement the callback to fetch agent
resource versions from database, the status updates with
agent resource versions included, and the fast path agent to
neutron-servers fanout call with version details as defined
in change I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad
Related-Bug: #1535247
Change-Id: I3fb49ae6fe237a926225b508bc8f0286426bf532
Since oslo.versionedobjects 0.8.0, the object is not backported if the
requested version is the same as the latest known.
Change-Id: Ia1e9aa77b75261e4b2d2b24f31250ce2a2f028a7
__init__ is called for any __call__ on a class, no matter whether it is
a singleton. Meaning, client was reinitialized every time a caller
instantiated the Rpc class. That's not a critical issue, but a minor
performance hit.
Change-Id: I24272ba44eb502c8552d3556c84214942944646c
Partially-Implements: blueprint quantum-qos-api
The update policy works. We still need to track down the deletes which
don't work currently.
Change-Id: I48e04b42c07c34cf1daa17e7a29a6950453946ff
Partially-Implements: blueprint quantum-qos-api
This patch also refactors existing test cases for server side rpc
classes in order to test code in generic manner. Finally, we remove
notify() and get_resource() from consumers or producers modules
respectively in order to remove circular dependencies. The notificitaion
driver will send events directly using RPC api class instead of going
through registry.
Co-Authored-By: Miguel Angel Ajo <mangelajo@redhat.com>
Partially-Implements: blueprint quantum-qos-api
Change-Id: I9120748505856acc7aa8d15d896697dd8487bb02
Split rpc.callbacks interface into consumer and producer parts.
Better terms are chosen for two RPC APIs we have:
- pull when a component actively requests a new object state;
- push when a component updates anyone interested about an object
change.
Also, for callback registration, the following terms are used:
- subscribe when a component is registered in consumer registry;
- provide when a component is registered in provider registry.
Covered the registries with some unit tests.
Lots of existing tests utilize the registries now, and need to be
isolated from other tests that mess with the managers (that are
singletons), so introduced a common qos base test class to mock the
manager with per-test instance of it).
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Partially-Implements: blueprint quantum-qos-api
Change-Id: I130cfbc8b78da6df4405b90ea1ab47899491ba41
Also switched RPC callback API to consistently receive resource_type
string and not a resource class. This is because for get_info(), we
cannot propagate a class thru RPC but only a string that uniquely
identifies the class. So it would be not optimal to require the server
to discover the corresponding class from the type name passed from the
agent.
Also updated some comments in api/rpc/callbacks directory to reflect
that we handle NeutronObjects, not dicts.
Finally, killed the rule resource registration from QoS plugin and the
rule type from supported resources since it's YAGNI at least now.
Partially-Implements: blueprint quantum-qos-api
Change-Id: I5929338953a2ad7fa68312d79394a306eb0164a2