[ovn]: gracefully handle logical switch ports with tag set to None

AddLSwitchPortCommand takes kwargs as columns and tag is one of them.
It is possible that tag is provided with the value None and that is
not valid. The proposed change gracefully handles such cases so the
transaction is not aborted.

Change-Id: I0f3cb6f534072e166610b417059acbe89302473a
Closes-Bug: #1888736
(cherry picked from commit fe440bdd6b)
This commit is contained in:
Flavio Fernandes 2020-07-23 19:02:34 -04:00 committed by Jakub Libosvar
parent 96d66095fc
commit 423e3907bc
1 changed files with 1 additions and 0 deletions

View File

@ -125,6 +125,7 @@ class AddLSwitchPortCommand(command.BaseCommand):
port = txn.insert(self.api._tables['Logical_Switch_Port'])
port.name = self.lport
port.tag = self.columns.pop('tag', []) or []
dhcpv4_options = self.columns.pop('dhcpv4_options', [])
if isinstance(dhcpv4_options, list):
port.dhcpv4_options = dhcpv4_options