Merge "Only use ports with non empy list of fixed_ips"

This commit is contained in:
Jenkins 2015-07-21 12:02:47 +00:00 committed by Gerrit Code Review
commit ede7402604
1 changed files with 3 additions and 1 deletions

View File

@ -433,7 +433,9 @@ class FloatingIpManager(network_base.FloatingIpManager):
def _get_reachable_subnets(self, ports):
if not is_enabled_by_config('enable_fip_topology_check', True):
# All subnets are reachable from external network
return set(p.fixed_ips[0]['subnet_id'] for p in ports)
return set(
p.fixed_ips[0]['subnet_id'] for p in ports if p.fixed_ips
)
# Retrieve subnet list reachable from external network
ext_net_ids = [ext_net.id for ext_net in self.list_pools()]
gw_routers = [r.id for r in router_list(self.request)