Merge "Fix IndexError when no VLAN tag is defined"

This commit is contained in:
Zuul 2023-05-03 09:26:56 +00:00 committed by Gerrit Code Review
commit 2d29afc58f

View File

@ -186,7 +186,7 @@ class OvsdbNbOvnIdl(nb_impl_idl.OvnNbApiIdlImpl, Backend):
cmd = self.db_find_rows('Logical_Switch_Port', ('type', '=',
constants.OVN_LOCALNET_VIF_PORT_TYPE))
for row in cmd.execute(check_error=True):
if (row.options and
if (row.tag and row.options and
row.options.get('network_name') == network_name):
tags.append(row.tag[0])
return tags
@ -333,7 +333,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
cmd = self.db_find_rows('Port_Binding', ('type', '=',
constants.OVN_LOCALNET_VIF_PORT_TYPE))
for row in cmd.execute(check_error=True):
if (row.options and
if (row.tag and row.options and
row.options.get('network_name') == network_name):
tags.append(row.tag[0])
return tags