Commit Graph

20 Commits

Author SHA1 Message Date
Rajesh Tailor 8ab5ee1d17 Fix remaining typos in comments and tests
Change-Id: I872422cffd1f9a2e59b5e18a86695e5cb6edc2cd
2022-07-06 21:20:27 +05:30
Nurmatov Mamatisa 4aa5de254d use payloads for NETWORK callback events
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
2021-05-08 20:50:46 +03:00
Brian Haley 7594bb0627 Remove the dependency on the "mock" package
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
2020-04-28 18:05:37 -04:00
Boden R 68fd13af40 remove neutron.common.exceptions
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
2019-02-01 14:35:00 -07:00
Hongbin Lu 12bb26fd0e Use constant IP_VERSION_4/6 in unit tests
Change-Id: I54bec2c06940b0b1362fecacef7860361d081601
2018-08-27 21:45:39 +00:00
Hongbin Lu b2ee55a532 Add test cases for external network default
Change-Id: Ic119ecd755a49e88fbee7302bd74f8397bac7843
2018-02-09 16:55:39 +00:00
Ankur Gupta 55090400ad OVO External Networks
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
2017-03-07 20:03:30 +00:00
Armando Migliaccio ca751a1486 Spin off context module
NeutronLibImpact

Partially-implements: blueprint neutron-lib

Change-Id: I48cf45dc1b07035d952152eac2548a3bd9fc2832
2017-03-06 16:25:29 +00:00
Jenkins 27eccafa5b Merge "Make DHCP notifier use core resource events" 2016-09-14 21:11:53 +00:00
Kevin Benton 181bdb374f Make DHCP notifier use core resource events
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
2016-09-14 00:40:09 -07:00
Kevin Benton a4ccc0ce1c Move retry decorator in auto allocate
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
2016-09-09 09:00:48 +00:00
Armando Migliaccio e2fdeefd37 Deal with unknown exceptions during auto allocation
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
2016-09-02 15:37:23 +00:00
Gary Kotton 8fdc430e62 Auto allocation: ensure that networks and subnets are cleaned up
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
2016-08-29 08:42:03 -07:00
Armando Migliaccio 960eae574b Catch SubnetAllocationError during auto-allocated-topology provisioning
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
2016-08-23 16:55:52 -07:00
Armando Migliaccio dfa702fac8 Implement the DELETE method for get-me-a-network
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
2016-08-22 17:59:34 -07:00
Armando Migliaccio aa42906143 Make auto-allocate plugin handle sneaky DB errors
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
2016-08-12 15:27:41 -07:00
Henry Gessau ae5bad49cc Use exceptions from neutron-lib
Related-Blueprint: neutron-lib

Change-Id: Ia014468bd621c4ee6aea95bf19328c61070174c4
2016-04-21 21:29:44 -04:00
Armando Migliaccio 1091eea1fd Allow auto-allocate's dry-run API call to work for regular users
Add tenant_id to allow for policy check to succeed.

Change-Id: I4f470e683406564aaed91faebb010bce27655b39
Closes-bug: #1552059
2016-03-01 19:16:36 -08:00
Armando Migliaccio 96ddba4a71 Provide dry-run flag to validate deployment requirements
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
2016-02-29 21:02:05 -08:00
Armando Migliaccio 3785dc31a4 Address masking issue during auto-allocation failure
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
2016-02-12 17:49:10 -08:00