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
This commit is contained in:
Terry Wilson 2020-05-12 15:29:38 +00:00
parent 2ac52607c2
commit c05bac8c40
1 changed files with 1 additions and 0 deletions

View File

@ -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