]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Ensure that update_fip_statuses gets called
authorCarl Baldwin <carl.baldwin@hp.com>
Thu, 9 Jul 2015 18:44:16 +0000 (18:44 +0000)
committerCarl Baldwin <carl.baldwin@hp.com>
Thu, 9 Jul 2015 22:33:37 +0000 (22:33 +0000)
Calling it even when ex_gw_port is None will update fip statuses to
down when the gateway port is removed.

Change-Id: I0250fda7269bbd79839bf6e7c141f196adc1bd3b
Closes-Bug: <TODO> (bug needs confirmation, found this by inspection)

neutron/agent/l3/router_info.py

index 978f2f8c8a34334357124633c44db5e4bb1b89c7..830479452484098f2239708797c383f0242a6a96 100644 (file)
@@ -590,13 +590,12 @@ class RouterInfo(object):
                              action)
 
     def process_external(self, agent):
+        fip_statuses = {}
         existing_floating_ips = self.floating_ips
         try:
             with self.iptables_manager.defer_apply():
                 ex_gw_port = self.get_ex_gw_port()
                 self._process_external_gateway(ex_gw_port)
-                # TODO(Carl) Return after setting existing_floating_ips and
-                # still call update_fip_statuses?
                 if not ex_gw_port:
                     return
 
@@ -614,8 +613,9 @@ class RouterInfo(object):
                 # All floating IPs must be put in error state
                 LOG.exception(e)
                 fip_statuses = self.put_fips_in_error_state()
-
-        agent.update_fip_statuses(self, existing_floating_ips, fip_statuses)
+        finally:
+            agent.update_fip_statuses(
+                self, existing_floating_ips, fip_statuses)
 
     @common_utils.exception_logger()
     def process(self, agent):