]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Filter out router ports without IPs when gathering router sync data
authorSalvatore Orlando <salv.orlando@gmail.com>
Thu, 7 Mar 2013 11:32:32 +0000 (12:32 +0100)
committerSalvatore Orlando <salv.orlando@gmail.com>
Fri, 8 Mar 2013 23:23:29 +0000 (00:23 +0100)
Bug 1152050

Change-Id: Idd11d5f953129471c09f44b4f7c75dc9899d6783

quantum/db/l3_db.py

index 514d7a691d5e05f93fd1ef060a651daa1e0e2410..e21e8b4dc677dccf5667552f84847608fb83f609 100644 (file)
@@ -929,10 +929,15 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
         for port in ports:
             fixed_ips = port.get('fixed_ips', [])
             if len(fixed_ips) > 1:
-                LOG.error(_("Ignoring multiple IPs on router port %s"),
-                          port['id'])
+                LOG.info(_("Ignoring multiple IPs on router port %s"),
+                         port['id'])
+                continue
+            elif not fixed_ips:
+                # Skip ports without IPs, which can occur if a subnet
+                # attached to a router is deleted
+                LOG.info(_("Skipping port %s as no IP is configure on it"),
+                         port['id'])
                 continue
-            # Empty fixed_ips should not happen
             fixed_ip = fixed_ips[0]
             my_ports = subnet_id_ports_dict.get(fixed_ip['subnet_id'], [])
             my_ports.append(port)