]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove an external interface when router-gateway is removed.
authorAkihiro MOTOKI <motoki@da.jp.nec.com>
Mon, 10 Sep 2012 12:35:29 +0000 (21:35 +0900)
committerAkihiro MOTOKI <motoki@da.jp.nec.com>
Mon, 10 Sep 2012 12:39:07 +0000 (21:39 +0900)
Fixes bug 1048617

Change-Id: Ib7e80fcd6b7e2ffd974067a8039dd74f25005856

quantum/agent/l3_agent.py

index 902d60c62f60ffe4daf0dad31cf3cf1fd0a92aa5..96fe5b402f06cd9af3d11859d95fff9a58cdd341 100644 (file)
@@ -202,7 +202,8 @@ class L3NATAgent(object):
             if not r['admin_state_up']:
                 continue
 
-            ex_net_id = r['external_gateway_info'].get('network_id', None)
+            ex_net_id = (r['external_gateway_info'] and
+                         r['external_gateway_info'].get('network_id'))
             if not ex_net_id and not self.conf.handle_internal_only_routers:
                 continue
 
@@ -381,7 +382,8 @@ class L3NATAgent(object):
         if ip_lib.device_exists(interface_name,
                                 root_helper=self.conf.root_helper,
                                 namespace=ri.ns_name()):
-            self.driver.unplug(interface_name)
+            self.driver.unplug(interface_name,
+                               bridge=self.conf.external_network_bridge)
 
         ex_gw_ip = ex_gw_port['fixed_ips'][0]['ip_address']
         for c, r in self.external_gateway_filter_rules():