Fix type for config option bgp_chassis_id

Type List was wrongly used. Type Str should be used instead.

Closes-Bug: #2088057
Change-Id: I26e04725ce419f87b8cde78567e88fe479cee1ae
This commit is contained in:
Eduardo Olivares 2024-11-13 12:36:23 +01:00
parent a01dddcefa
commit 4f8fe6adbf
2 changed files with 23 additions and 8 deletions

View File

@ -231,7 +231,7 @@ local_ovn_cluster_opts = [
cfg.ListOpt('provider_networks_pool_prefixes', cfg.ListOpt('provider_networks_pool_prefixes',
default=['192.168.0.0/16'], default=['192.168.0.0/16'],
help='List of prefixes for provider networks'), help='List of prefixes for provider networks'),
cfg.ListOpt('bgp_chassis_id', cfg.StrOpt('bgp_chassis_id',
default='bgp', default='bgp',
help='The chassis_id used for the ovn-controller instance' help='The chassis_id used for the ovn-controller instance'
' related to the node-local OVN instance. Used as a' ' related to the node-local OVN instance. Used as a'

View File

@ -15,6 +15,7 @@
from unittest import mock from unittest import mock
from oslo_config import cfg
from ovsdbapp.schema.open_vswitch import impl_idl as idl_ovs from ovsdbapp.schema.open_vswitch import impl_idl as idl_ovs
from ovn_bgp_agent import constants from ovn_bgp_agent import constants
@ -24,6 +25,9 @@ from ovn_bgp_agent.tests import base as test_base
from ovn_bgp_agent.utils import linux_net from ovn_bgp_agent.utils import linux_net
CONF = cfg.CONF
class TestOVS(test_base.TestCase): class TestOVS(test_base.TestCase):
def setUp(self): def setUp(self):
@ -484,7 +488,18 @@ class TestOvsIdl(test_base.TestCase):
'Open_vSwitch', '.', 'external_ids') 'Open_vSwitch', '.', 'external_ids')
def test_get_ovn_bridge_mappings_bridge(self): def test_get_ovn_bridge_mappings_bridge(self):
bridge = 'bgp' bridge = 'bgp1'
self.execute_ref.return_value = {
'ovn-bridge-mappings-bgp1':
'net0:bridge0,net1:bridge1, net2:bridge2'}
ret = self.ovs_idl.get_ovn_bridge_mappings(bridge=bridge)
self.assertEqual(['net0:bridge0', 'net1:bridge1', 'net2:bridge2'], ret)
self.ovs_idl.idl_ovs.db_get.assert_called_once_with(
'Open_vSwitch', '.', 'external_ids')
def test_get_ovn_bridge_mappings_default_bridge(self):
# bgp_chassis_id defaults to 'bgp'
bridge = CONF.local_ovn_cluster.bgp_chassis_id
self.execute_ref.return_value = { self.execute_ref.return_value = {
'ovn-bridge-mappings-bgp': 'ovn-bridge-mappings-bgp':
'net0:bridge0,net1:bridge1, net2:bridge2'} 'net0:bridge0,net1:bridge1, net2:bridge2'}