diff --git a/neutron/common/exceptions.py b/neutron/common/exceptions.py index 63ff13894d..65c05af433 100644 --- a/neutron/common/exceptions.py +++ b/neutron/common/exceptions.py @@ -178,7 +178,7 @@ class NoNetworkAvailable(ResourceExhausted): "No tenant network is available for allocation.") -class SubnetMismatchForPort(Conflict): +class SubnetMismatchForPort(BadRequest): message = _("Subnet on port %(port_id)s does not match " "the requested subnet %(subnet_id)s") diff --git a/neutron/tests/unit/bigswitch/test_router_db.py b/neutron/tests/unit/bigswitch/test_router_db.py index a5d16068be..72712fa7cd 100644 --- a/neutron/tests/unit/bigswitch/test_router_db.py +++ b/neutron/tests/unit/bigswitch/test_router_db.py @@ -112,7 +112,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): cfg.CONF.reset() test_l3_plugin.L3NatDBTestCase.setUp = origSetUp - def test_router_remove_router_interface_wrong_subnet_returns_409(self): + def test_router_remove_router_interface_wrong_subnet_returns_400(self): with self.router() as r: with self.subnet() as s: with self.subnet(cidr='10.0.10.0/24') as s1: @@ -125,7 +125,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): r['router']['id'], s['subnet']['id'], p['port']['id'], - exc.HTTPConflict.code) + exc.HTTPBadRequest.code) #remove properly to clean-up self._router_interface_action('remove', r['router']['id'], @@ -213,7 +213,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): subnet['subnet']['network_id'], expected_code=exc.HTTPConflict.code) - def test_router_remove_interface_wrong_subnet_returns_409(self): + def test_router_remove_interface_wrong_subnet_returns_400(self): with self.router() as r: with self.subnet(cidr='10.0.10.0/24') as s: with self.port(no_delete=True) as p: @@ -225,7 +225,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): r['router']['id'], s['subnet']['id'], p['port']['id'], - exc.HTTPConflict.code) + exc.HTTPBadRequest.code) #remove properly to clean-up self._router_interface_action('remove', r['router']['id'], diff --git a/neutron/tests/unit/nicira/test_nicira_plugin.py b/neutron/tests/unit/nicira/test_nicira_plugin.py index 80c4575dba..00746350c4 100644 --- a/neutron/tests/unit/nicira/test_nicira_plugin.py +++ b/neutron/tests/unit/nicira/test_nicira_plugin.py @@ -514,9 +514,9 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, self.test_router_remove_interface_inuse_returns_409() self._nvp_metadata_teardown() - def test_router_remove_iface_wrong_sub_returns_409_with_metadata(self): + def test_router_remove_iface_wrong_sub_returns_400_with_metadata(self): self._nvp_metadata_setup() - self.test_router_remove_interface_wrong_subnet_returns_409() + self.test_router_remove_interface_wrong_subnet_returns_400() self._nvp_metadata_teardown() def test_router_delete_with_metadata_access(self): diff --git a/neutron/tests/unit/test_l3_plugin.py b/neutron/tests/unit/test_l3_plugin.py index 2145b6e630..3ce117cd1a 100644 --- a/neutron/tests/unit/test_l3_plugin.py +++ b/neutron/tests/unit/test_l3_plugin.py @@ -989,7 +989,7 @@ class L3NatDBTestCase(L3NatTestCaseBase): s['subnet']['id'], None) - def test_router_remove_interface_wrong_subnet_returns_409(self): + def test_router_remove_interface_wrong_subnet_returns_400(self): with self.router() as r: with self.subnet() as s: with self.port(no_delete=True) as p: @@ -1001,7 +1001,7 @@ class L3NatDBTestCase(L3NatTestCaseBase): r['router']['id'], s['subnet']['id'], p['port']['id'], - exc.HTTPConflict.code) + exc.HTTPBadRequest.code) #remove properly to clean-up self._router_interface_action('remove', r['router']['id'],