ovs-fw: catches exception from ovsdb

OVS agent will raise an exception when deleting
multiple vms in bulk. Nova will delete tap when vms are
removed. Then, ovs agent checks ovs_port
by calling "self.get_ovs_port", and the exception will be raised.
The patch will catch exception.

Change-Id: Ief7de22e5f85253d8a25ecfbb139a8f87c1a0b35
Closes-Bug: #1729213
This commit is contained in:
Zachary 2017-11-07 09:09:48 +08:00
parent 5fc8e47786
commit 364e5db586
1 changed files with 7 additions and 1 deletions

View File

@ -507,7 +507,13 @@ class OVSFirewallDriver(firewall.FirewallDriver):
self.prepare_port_filter(port)
return
old_of_port = self.get_ofport(port)
of_port = self.get_or_create_ofport(port)
try:
of_port = self.get_or_create_ofport(port)
except exceptions.OVSFWPortNotFound as not_found_error:
LOG.info("port %(port_id)s does not exist in ovsdb: %(err)s.",
{'port_id': port['device'],
'err': not_found_error})
return
# TODO(jlibosva): Handle firewall blink
self.delete_all_port_flows(old_of_port)
self.initialize_port_flows(of_port)