neutron/neutron/tests/unit
Kevin Benton 77de9653fd Raise RetryRequest on policy parent not found
During a port list operation, a port and its parent network
may be concurrently deleted from the database after they have
been retrieved from the DB but before policy is enforced.
Then when the policy engine tries to do a get_network to check
network ownership for a port on a network that no longer exists,
it will encounter a NetworkNotFound exception from the core plugin.

This exception was being propagated all of the way up to the whole
API operation as a 404, which made no sense in the context of a
port list.

This patch adjusts the logic to catch any NotFound exceptions during
this processing and convert them into a RetryRequest to trigger the
API to restart the operation. At this point the objects will be gone
from the database so the problematic items will not be passed to the
policy engine for enforcement.

Closes-Bug: #1528031
Change-Id: I89d12fe0767e1c7ecb68138b5f6f17aa68a68769
2016-01-27 05:23:38 -08:00
..
agent Merge "Rule, member updates are missed with enhanced rpc" 2016-01-23 01:27:53 +00:00
api Pecan: Streamline request body processing 2016-01-11 04:07:34 -08:00
callbacks Provide kwargs for callback abort 2016-01-12 21:48:05 +00:00
cmd Make neutron pecan server an option instead of binary 2016-01-14 18:25:13 -08:00
common Unify assertEqual for empty usages 2016-01-07 10:06:35 +00:00
core_extensions QoS core extension: fixed dict extension when QoS policy is unset 2015-08-08 15:44:27 +02:00
db Merge "Prevent PD subnets with incorrect IPv6 modes" 2016-01-22 16:07:36 +00:00
debug tests: stop validating neutronclient in neutron-debug tests 2016-01-14 06:46:45 +00:00
extensions Merge "Add L3 Notifications To Enable BGP Dynamic Routing" 2016-01-22 16:06:46 +00:00
hacking Unify using assertIsInstance 2016-01-15 00:06:03 +08:00
ipam Merge "Use compare-and-swap for IpamAvailabilityRange" 2015-11-20 22:05:59 +00:00
notifiers Add option for nova endpoint type 2015-12-10 08:40:36 +00:00
objects Move helper methods to create resorces to test_base 2016-01-21 19:23:14 +00:00
plugins Merge "OVS agent should fail if it can't get DVR mac address" 2016-01-23 00:12:45 +00:00
quota Remove references to model_base through models_v2 2016-01-06 16:12:29 -07:00
scheduler Merge "fix get_ha_sync_data_for_host for non-dvr agent" 2016-01-16 14:09:29 +00:00
services Fix params order in assertEqual 2016-01-13 18:24:04 +05:30
tests Fix params order in assertEqual 2016-01-13 18:24:04 +05:30
__init__.py oslo: migrate to namespace-less import paths 2015-02-05 15:09:32 +01:00
_test_extension_portbindings.py Context: Remove logic for read_deleted and deprecate it 2015-06-09 13:50:03 -07:00
dummy_plugin.py Fixed a bunch of typos throughout Neutron 2015-10-30 08:54:41 -05:00
extension_stubs.py Merge "Simplify extension processing" 2016-01-10 11:19:24 +00:00
test_auth.py Fix params order in assertEqual 2016-01-13 18:24:04 +05:30
test_context.py Support Unicode request_id on Python 3 2015-11-27 16:21:16 +01:00
test_manager.py Pecan controller loads service plugins 2016-01-12 12:28:54 -08:00
test_policy.py Raise RetryRequest on policy parent not found 2016-01-27 05:23:38 -08:00
test_service.py Refactor TestRpcWorker and TestWorkerService 2015-06-16 15:49:48 +03:00
test_wsgi.py Make sure we return unicode strings for process output 2015-11-20 16:49:51 +01:00
testlib_api.py Improve fixture usage. 2015-07-01 14:53:48 +12:00