Browse Source

Merge "Fix update_port() SubnetNotFound race conditional"

Zuul 5 months ago
parent
commit
cc05180e32
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      networking_ovn/common/ovn_client.py

+ 5
- 2
networking_ovn/common/ovn_client.py View File

@@ -212,9 +212,12 @@ class OVNClient(object):
212 212
             tag = binding_prof.get('tag', [])
213 213
             address = port['mac_address']
214 214
             for ip in port.get('fixed_ips', []):
215
+                try:
216
+                    subnet = self._plugin.get_subnet(
217
+                        n_context.get_admin_context(), ip['subnet_id'])
218
+                except n_exc.SubnetNotFound:
219
+                    continue
215 220
                 address += ' ' + ip['ip_address']
216
-                subnet = self._plugin.get_subnet(n_context.get_admin_context(),
217
-                                                 ip['subnet_id'])
218 221
                 cidrs += ' {}/{}'.format(ip['ip_address'],
219 222
                                          subnet['cidr'].split('/')[1])
220 223
             port_security, new_macs = \

Loading…
Cancel
Save