From d36940b720616ec6607c62eca50023eb00bdae01 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 16 Apr 2015 13:39:55 +0900 Subject: [PATCH] ovs_lib: Fix a race between get_port_tag_dict and port removal get_port_tag_dict() gets a list of ports using get_port_name_list() and then queries the db again for ports in the list. It fails if some of ports disappeared in between. This change fixes it by ignoring "not exist" errors in the later query. Closes-Bug: #1444797 Change-Id: Ic54b644bb1d72a4664b70f124863d17805c26fff --- neutron/agent/common/ovs_lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neutron/agent/common/ovs_lib.py b/neutron/agent/common/ovs_lib.py index 3004bc99b..1576b1580 100644 --- a/neutron/agent/common/ovs_lib.py +++ b/neutron/agent/common/ovs_lib.py @@ -388,7 +388,8 @@ class OVSBridge(BaseOVS): """ port_names = self.get_port_name_list() - cmd = self.ovsdb.db_list('Port', port_names, columns=['name', 'tag']) + cmd = self.ovsdb.db_list('Port', port_names, columns=['name', 'tag'], + if_exists=True) results = cmd.execute(check_error=True) return {p['name']: p['tag'] for p in results} -- 2.45.2