Don't try to store protocol=None in OVSDB
The schema for the 'protocol' column is 0 or 1 strings in the set
('tcp', 'udp', 'sctp'). Empty optional values in OVSDB are
represented by []. Passing None will cause a schema error to be
thrown, so pass [] instead of None when protocol is not set.
Change-Id: Ibde099db717787d7905d7c7850bebda7e9e261a8
Closes-Bug: #1916646
(cherry picked from commit a641c2c395
)
This commit is contained in:
parent
67f3d63b95
commit
674203b4bf
|
@ -789,7 +789,7 @@ class OvnProviderHelper(object):
|
|||
break
|
||||
|
||||
# If protocol set make sure its lowercase
|
||||
protocol = protocol.lower() if protocol else None
|
||||
protocol = protocol.lower() if protocol else []
|
||||
# In case port is not found for the vip_address we will see an
|
||||
# exception when port['id'] is accessed.
|
||||
external_ids = {
|
||||
|
|
|
@ -325,7 +325,7 @@ class TestOvnProviderHelper(ovn_base.TestOvnOctaviaBase):
|
|||
ovn_const.LB_EXT_IDS_VIP_PORT_ID_KEY: mock.ANY,
|
||||
'enabled': 'False'},
|
||||
name=mock.ANY,
|
||||
protocol=None,
|
||||
protocol=[],
|
||||
selection_fields=['ip_src', 'ip_dst', 'tp_src', 'tp_dst'])
|
||||
|
||||
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
|
||||
|
@ -343,7 +343,7 @@ class TestOvnProviderHelper(ovn_base.TestOvnOctaviaBase):
|
|||
ovn_const.LB_EXT_IDS_VIP_PORT_ID_KEY: mock.ANY,
|
||||
'enabled': 'True'},
|
||||
name=mock.ANY,
|
||||
protocol=None,
|
||||
protocol=[],
|
||||
selection_fields=['ip_src', 'ip_dst', 'tp_src', 'tp_dst'])
|
||||
|
||||
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
|
||||
|
@ -363,7 +363,7 @@ class TestOvnProviderHelper(ovn_base.TestOvnOctaviaBase):
|
|||
ovn_const.LB_EXT_IDS_VIP_PORT_ID_KEY: mock.ANY,
|
||||
'enabled': 'True'},
|
||||
name=mock.ANY,
|
||||
protocol=None)
|
||||
protocol=[])
|
||||
|
||||
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
|
||||
def test_lb_create_selection_fields_not_supported_algo(self, net_cli):
|
||||
|
@ -383,7 +383,7 @@ class TestOvnProviderHelper(ovn_base.TestOvnOctaviaBase):
|
|||
ovn_const.LB_EXT_IDS_VIP_PORT_ID_KEY: mock.ANY,
|
||||
'enabled': 'True'},
|
||||
name=mock.ANY,
|
||||
protocol=None,
|
||||
protocol=[],
|
||||
selection_fields=['ip_src', 'ip_dst', 'tp_src', 'tp_dst'])
|
||||
|
||||
@mock.patch('ovn_octavia_provider.common.clients.get_neutron_client')
|
||||
|
|
Loading…
Reference in New Issue