]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Revert "Cleanup floatingips also on router delete"
authorarmando-migliaccio <armamig@gmail.com>
Tue, 16 Sep 2014 01:40:08 +0000 (18:40 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Thu, 25 Sep 2014 19:13:06 +0000 (12:13 -0700)
This reverts commit c3326996e38cb67f8d4ba3dabd829dc6f327b666.

The patch being reverted here addresses an issue that can no longer be
reproduced, in that under no circumstances, I can make the FIP lie around
before deleting a router (which can only be done after all FIP have been
disassociated or released).

Unless we have more clarity as to what the initial commit was really meant
to fix, there is a strong case for reverting this patch at this point.

Closes-bug: #1373100

Change-Id: I7e0f80e456ff4d9eb57a1d31c6ffc7cdfca5a163

neutron/agent/l3_agent.py
neutron/tests/unit/test_l3_agent.py

index 84953bc2e227bcdd956748aade494e24b17afbae..c12693558e44cd51f601f11b975f3da81dfeacc4 100644 (file)
@@ -948,7 +948,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
         # Process SNAT/DNAT rules for floating IPs
         fip_statuses = {}
         try:
-            if ex_gw_port or ri.ex_gw_port:
+            if ex_gw_port:
                 existing_floating_ips = ri.floating_ips
                 self.process_router_floating_ip_nat_rules(ri)
                 ri.iptables_manager.defer_apply_off()
@@ -962,7 +962,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
             for fip in ri.router.get(l3_constants.FLOATINGIP_KEY, []):
                 fip_statuses[fip['id']] = l3_constants.FLOATINGIP_STATUS_ERROR
 
-        if ex_gw_port or ri.ex_gw_port:
+        if ex_gw_port:
             # Identify floating IPs which were disabled
             ri.floating_ips = set(fip_statuses.keys())
             for fip_id in existing_floating_ips - ri.floating_ips:
index 0be506e7ce66bf27475ef854995b858e817a709e..c9fb026f301f056fe00a66e313a5e901b353724f 100644 (file)
@@ -988,17 +988,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
         del router[l3_constants.INTERFACE_KEY]
         del router['gw_port']
         agent.process_router(ri)
-        ex_gw_port = agent._get_ex_gw_port(ri)
         self.assertEqual(self.send_arp.call_count, 1)
-        agent.process_router_floating_ip_addresses.assert_called_with(
-            ri, ex_gw_port)
-        agent.process_router_floating_ip_addresses.reset_mock()
-        agent.process_router_floating_ip_nat_rules.assert_called_with(ri)
-        agent.process_router_floating_ip_nat_rules.reset_mock()
-
-        # now no ports no gateway, test state tear down
-        ri.ex_gw_port = None
-        agent.process_router(ri)
         self.assertFalse(agent.process_router_floating_ip_addresses.called)
         self.assertFalse(agent.process_router_floating_ip_nat_rules.called)