From 90264aca8e93f71de1107690e3749fab0f601bf4 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 13 Nov 2024 08:07:42 +0000 Subject: [PATCH] Bump ovs library minimum version to 2.12.0 This library version includes the input parameter ``leader_only`` in ``ovs.db.idl.Idl`` class signature. Change-Id: I10bd3750f818c96fe7ba6d5f847655641ca61f69 --- neutron/agent/ovn/agent/ovsdb.py | 14 ++------------ neutron/agent/ovn/metadata/ovsdb.py | 8 +------- .../drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py | 12 ++---------- requirements.txt | 2 +- 4 files changed, 6 insertions(+), 30 deletions(-) diff --git a/neutron/agent/ovn/agent/ovsdb.py b/neutron/agent/ovn/agent/ovsdb.py index 573b7b7d89e..366a4973ac6 100644 --- a/neutron/agent/ovn/agent/ovsdb.py +++ b/neutron/agent/ovn/agent/ovsdb.py @@ -38,12 +38,7 @@ class MonitorAgentOvnSbIdl(ovsdb_monitor.OvnIdl): helper = self._get_ovsdb_helper(connection_string) for table in tables: helper.register_table(table) - try: - super().__init__(None, connection_string, helper, - leader_only=False) - except TypeError: - # TODO(twilson) We can remove this when we require ovs>=2.12.0 - super().__init__(None, connection_string, helper) + super().__init__(None, connection_string, helper, leader_only=False) if chassis: for table in set(tables).intersection({'Chassis', 'Chassis_Private'}): @@ -76,12 +71,7 @@ class MonitorAgentOvnNbIdl(ovsdb_monitor.OvnIdl): helper = self._get_ovsdb_helper(connection_string) for table in tables: helper.register_table(table) - try: - super().__init__(None, connection_string, helper, - leader_only=False) - except TypeError: - # TODO(twilson) We can remove this when we require ovs>=2.12.0 - super().__init__(None, connection_string, helper) + super().__init__(None, connection_string, helper, leader_only=False) if events: self.notify_handler.watch_events(events) diff --git a/neutron/agent/ovn/metadata/ovsdb.py b/neutron/agent/ovn/metadata/ovsdb.py index 402f0f45f36..c82020fe5fb 100644 --- a/neutron/agent/ovn/metadata/ovsdb.py +++ b/neutron/agent/ovn/metadata/ovsdb.py @@ -40,13 +40,7 @@ class MetadataAgentOvnSbIdl(ovsdb_monitor.OvnIdl): 'SB_Global') for table in tables: helper.register_table(table) - try: - super().__init__( - None, connection_string, helper, leader_only=False) - except TypeError: - # TODO(twilson) We can remove this when we require ovs>=2.12.0 - super().__init__( - None, connection_string, helper) + super().__init__(None, connection_string, helper, leader_only=False) if chassis: for table in set(tables).intersection({'Chassis', 'Chassis_Private'}): diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py index 5e60710781a..4bc5e50dfbe 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py @@ -787,11 +787,7 @@ class BaseOvnSbIdl(Ml2OvnIdlBase): helper.register_table('Encap') helper.register_table('Port_Binding') helper.register_table('Datapath_Binding') - try: - return cls(connection_string, helper, leader_only=False) - except TypeError: - # TODO(twilson) We can remove this when we require ovs>=2.12.0 - return cls(connection_string, helper) + return cls(connection_string, helper, leader_only=False) class OvnIdl(BaseOvnIdl): @@ -933,11 +929,7 @@ class OvnSbIdl(OvnIdlDistributedLock): helper.register_table('Port_Binding') helper.register_table('Datapath_Binding') helper.register_columns('SB_Global', ['external_ids']) - try: - return cls(driver, connection_string, helper, leader_only=False) - except TypeError: - # TODO(twilson) We can remove this when we require ovs>=2.12.0 - return cls(driver, connection_string, helper) + return cls(driver, connection_string, helper, leader_only=False) def post_connect(self): """Watch Chassis events. diff --git a/requirements.txt b/requirements.txt index 539adaccf3c..7dfa0827308 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,7 +44,7 @@ oslo.versionedobjects>=1.35.1 # Apache-2.0 osprofiler>=2.3.0 # Apache-2.0 os-ken>=2.2.0 # Apache-2.0 os-resource-classes>=1.1.0 # Apache-2.0 -ovs>=2.10.0 # Apache-2.0 +ovs>=2.12.0 # Apache-2.0 ovsdbapp>=2.7.1 # Apache-2.0 psutil>=5.3.0 # BSD pyroute2>=0.7.3;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2)