This patch switches over to the payload style of callbacks for
NETWORK based events. As part of this change a few shims are needed
to handle cases where some callbacks don't yet use payloads and others
do. Once we move over to payloads for all callbacks the shims can be
removed.
NeutronLibImpact
Change-Id: I889364b5d184d47a79fe6ed604ce13a4b334acfa
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.
This patch moves all references to "import mock" to
"from unittest import mock". It also cleans up some new line
inconsistency.
Fixed an inconsistency in the OVSBridge.deferred() definition
as it needs to also have an *args argument.
Fixed an issue where an l3-agent test was mocking
functools.partial, causing a python3.8 failure.
Unit tests only, removing from tests/base.py affects
functional tests which need additional work.
Change-Id: I40e8a8410840c3774c72ae1a8054574445d66ece
Today the neutron common exceptions already live in neutron-lib and are
shimmed from neutron. This patch removes the neutron.common.exceptions
module and changes neutron's imports over to use their respective
neutron-lib exception module instead.
NeutronLibImpact
Change-Id: I9704f20eb21da85d2cf024d83338b3d94593671e
This patch introduces and implements Olso-Versioned Objects for
network extension External Networks.
There were joined performed to order the fetching of external
networks by standard attribute which seems useless because,
in networks/services/auto_allocated/db.py while fetching
external networks it logs error when multiple networks are
returned. Expected default external network there is one, so
ordering does not make much sense.
Co-Authored-By: Manjeet Singh Bhatia <manjeet.s.bhatia@intel.com>
Co-Authored-By: Victor Morales <victor.morales@intel.com>
Change-Id: Iad609f72945b84df7881b43d1fdf9a188e5816bc
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
This makes the notifier subscribe to core resource events
and leverage them if they are available. This solves the
issue where internal core plugin calls from service plugins
were not generating DHCP agent notifications.
Closes-Bug: #1621345
Change-Id: I607635601caff0322fd0c80c9023f5c4f663ca25
No longer necessary on cleanup since individual plugin operations
are protected but it should be on _ensure_network_default_value
callback since it can happen outside of a transaction.
Partial-Bug: #1612798
Change-Id: Iab4f2216e6b138296e8245eb0b1e3e6b5e46561b
Uncaught exceptions in the core or L3 plugin layers can cause the
auto_allocate plugin to fail unexpectedly. This patch ensures that
any unexpected error is properly handled by cleaning up half
provisioned deployment.
Related-bug: #1612798
Closes-bug: #1619497
Change-Id: I3eb9efd33363045f7b2ccd97fe4a48891f48b161
In the event of a router create failure we need to make sure that
the allocated resources are cleaned up.
When router allocation fails it is difficult for an admin to
understand the root cause. Adding the exception here will provide
a little additional information.
Closes-bug: #1617707
Change-Id: I41940bea0327ee31494bd95867d0e60d9b5a24b8
When uncaught, the auto_allocated_network stays behind. This patch
ensures the error is handled properly and the network is indeed
cleared when the subnetpool runs out of space.
Closes-bug: #1616250
Change-Id: Ic6e06d3e6c16a58977e84b371c3faaba66c9603b
Review [1] showed how tricky it can be to let the client
side deal with auto-network-topology cleanups. Rather than
pushing this complexity to the client, we should implement
the DELETE method for this extension, as it's rather
trival to do on this server side.
Since the DELETE method is exposed, but it fails with 500,
it is reasonable to deal with this as a bug fix, rather than
having to go through yet another extension. The neutronclient
side support should be added, but since the first user of this
is Tempest, we can safely assume they can leverage this directly
without depending on a python-neutronclient version bump.
[1] https://review.openstack.org/#/c/327191/
Closes-bug: #1614872
Change-Id: I2fba51bdf8c781fcc0449e1e9947de976c96eec4
DB errors or retry exceptions that bubble up to the
plugin may get masked by integrity violation errors
due to partial provisioning of resources. When that
happens, we should make sure any pending resource
is cleaned up before reattempting the operation.
Closes-bug: #1612615
Change-Id: I76e9f8e4b61fb3566d70af4236c19e4c5a523646
Nova may want to validate that the setup requirements
needed by the auto_allocate feature are met before
issuing the actual request to provision resources.
This patch adds this validation API.
Partial-implements: blueprint get-me-a-network
Change-Id: I9fb26e752650569fc5692ff8afda82a077647f7a
If an interface could not successfully be plugged to a router
during the provisioning of external connectivity, a failure
is triggered, and a subsequent cleanup performed.
This patch ensures that the cleanup accounts only for the
subnets that were uplinked successfully, thus fixing the
incomplete cleanup, and the masking user error that resulted
otherwise.
Closes-bug: #1545210
Change-Id: I061a1407abf6ed1a39056b1f72fd039919e2fc79