From c05bac8c4062ff2d4bb67a719aa11f61f608bbdb Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Tue, 12 May 2020 15:29:38 +0000 Subject: [PATCH] Set class ovsdb_conection to None We override ovsdbapp's Backend class to change from using a class variable for the ovsdb_connection to using an instance variable. This means we have to override several different methods/properties. This could be simplified in ovsdbapp by making ovsdb_connection a property, which in ovsdbapp access a class variable, and in neutron it is overridden to to store on the instance, so there would be less to override. ovsdbapp is adding user-definable indexed columns so things like lookups by name will be faster. Due to the way it is architected, the place to generate the indexes would be just before the connection starts. Since methods like start_connection are classmethods in ovsdbapp, and instance methods in neutron, this is hard to do cleanly w/o ovsdb_connection being a property. Without this change, neutron would fail if that property was defined. With the change, it should pass with both old and new code. Change-Id: Idd184807de24c79dd892046f01e3acdd1168ca2d --- .../plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py | 1 + 1 file changed, 1 insertion(+) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py index 996cf2bb9f5..a0dd2fe489a 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py @@ -56,6 +56,7 @@ class OvnNbTransaction(idl_trans.Transaction): # and therefor allows networking-ovn to manage connection scope on its own class Backend(ovs_idl.Backend): lookup_table = {} + ovsdb_connection = None def __init__(self, connection): self.ovsdb_connection = connection