diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py index 2ebecfbcb82..3f0aa1f2493 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py @@ -1055,7 +1055,8 @@ class OVNMechanismDriver(api.MechanismDriver): def delete_mac_binding_entries(self, external_ip): """Delete all MAC_Binding entries associated to this IP address""" - cmd = ['ovsdb-client', 'transact', ovn_conf.get_ovn_sb_connection()] + cmd = ['ovsdb-client', 'transact', ovn_conf.get_ovn_sb_connection(), + '--timeout', str(ovn_conf.get_ovn_ovsdb_timeout())] if ovn_conf.get_ovn_sb_private_key(): cmd += ['-p', ovn_conf.get_ovn_sb_private_key(), '-c', diff --git a/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py b/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py index 83528059a70..4bf921d7589 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py +++ b/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py @@ -91,6 +91,7 @@ class TestOVNMechanismDriver(test_plugin.Ml2PluginV2TestCase): self.mech_driver._nb_ovn = fakes.FakeOvsdbNbOvnIdl() self.mech_driver._sb_ovn = fakes.FakeOvsdbSbOvnIdl() self.mech_driver._ovn_client._qos_driver = mock.Mock() + cfg.CONF.set_override('ovsdb_connection_timeout', 30, group='ovn') self.nb_ovn = self.mech_driver._nb_ovn self.sb_ovn = self.mech_driver._sb_ovn @@ -116,7 +117,7 @@ class TestOVNMechanismDriver(test_plugin.Ml2PluginV2TestCase): def test_delete_mac_binding_entries(self): self.config(group='ovn', ovn_sb_private_key=None) - expected = ('ovsdb-client transact tcp:127.0.0.1:6642 ' + expected = ('ovsdb-client transact tcp:127.0.0.1:6642 --timeout 30 ' '\'["OVN_Southbound", {"op": "delete", "table": ' '"MAC_Binding", "where": [["ip", "==", "1.1.1.1"]]}]\'') with mock.patch.object(processutils, 'execute') as mock_execute: @@ -128,7 +129,7 @@ class TestOVNMechanismDriver(test_plugin.Ml2PluginV2TestCase): self.config(group='ovn', ovn_sb_private_key='pk') self.config(group='ovn', ovn_sb_certificate='cert') self.config(group='ovn', ovn_sb_ca_cert='ca') - expected = ('ovsdb-client transact tcp:127.0.0.1:6642 ' + expected = ('ovsdb-client transact tcp:127.0.0.1:6642 --timeout 30 ' '-p pk -c cert -C ca ' '\'["OVN_Southbound", {"op": "delete", "table": ' '"MAC_Binding", "where": [["ip", "==", "1.1.1.1"]]}]\'')