diff --git a/ovn_bgp_agent/config.py b/ovn_bgp_agent/config.py index 5c157245..9f7c95b4 100644 --- a/ovn_bgp_agent/config.py +++ b/ovn_bgp_agent/config.py @@ -30,6 +30,11 @@ agent_opts = [ cfg.StrOpt('driver', help='Driver to be used', default='ovn_bgp_driver'), + cfg.StrOpt('ovsdb_connection', + default='unix:/usr/local/var/run/openvswitch/db.sock', + help=_('The connection string for the native OVSDB backend.\n' + 'Use tcp:IP:PORT for TCP connection.\n' + 'Use unix:FILE for unix domain socket connection.')), cfg.StrOpt('ovn_sb_private_key', default='/etc/pki/tls/private/ovn_controller.key', help='The PEM file with private key for SSL connection to ' diff --git a/ovn_bgp_agent/constants.py b/ovn_bgp_agent/constants.py index a72274cc..30f5fb1c 100644 --- a/ovn_bgp_agent/constants.py +++ b/ovn_bgp_agent/constants.py @@ -23,7 +23,6 @@ OVN_LOCALNET_VIF_PORT_TYPE = "localnet" OVN_BGP_NIC = "ovn" OVN_BGP_VRF = "ovn-bgp-vrf" OVN_BGP_VRF_TABLE = 10 -OVS_CONNECTION_STRING = "unix:/var/run/openvswitch/db.sock" OVS_RULE_COOKIE = "999" OVS_VRF_RULE_COOKIE = "998" diff --git a/ovn_bgp_agent/drivers/openstack/ovn_bgp_driver.py b/ovn_bgp_agent/drivers/openstack/ovn_bgp_driver.py index 8e4656df..60a3c1de 100644 --- a/ovn_bgp_agent/drivers/openstack/ovn_bgp_driver.py +++ b/ovn_bgp_agent/drivers/openstack/ovn_bgp_driver.py @@ -70,7 +70,7 @@ class OVNBGPDriver(driver_api.AgentDriverBase): frr.vrf_leak(constants.OVN_BGP_VRF, CONF.bgp_AS, CONF.bgp_router_id) self.ovs_idl = ovs.OvsIdl() - self.ovs_idl.start(constants.OVS_CONNECTION_STRING) + self.ovs_idl.start(CONF.ovsdb_connection) self.chassis = self.ovs_idl.get_own_chassis_name() self.ovn_remote = self.ovs_idl.get_ovn_remote() LOG.debug("Loaded chassis %s.", self.chassis) diff --git a/ovn_bgp_agent/drivers/openstack/ovn_evpn_driver.py b/ovn_bgp_agent/drivers/openstack/ovn_evpn_driver.py index dc2d655c..35b60272 100644 --- a/ovn_bgp_agent/drivers/openstack/ovn_evpn_driver.py +++ b/ovn_bgp_agent/drivers/openstack/ovn_evpn_driver.py @@ -66,7 +66,7 @@ class OVNEVPNDriver(driver_api.AgentDriverBase): def start(self): self.ovs_idl = ovs.OvsIdl() - self.ovs_idl.start(constants.OVS_CONNECTION_STRING) + self.ovs_idl.start(CONF.ovsdb_connection) self.chassis = self.ovs_idl.get_own_chassis_name() self.ovn_remote = self.ovs_idl.get_ovn_remote() LOG.debug("Loaded chassis %s.", self.chassis)