From 2e10d78ba356fec5187eac07a51d41e6fcc0a29d Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Wed, 11 May 2022 15:41:52 +0000 Subject: [PATCH] Handle OVS 2.17 change to Idl.tables The update_tables() method needs to be updated to handle the new IdlTable structure. Ultimately, we should move the update_tables functionality into python_ovs. Until then, this should work with both old and new versions of OVS. Closes-Bug: #1972989 Co-authored-by: Rodolfo Alonso Change-Id: I173032f7cc63f79ee72ac7263188253e1cb6ff76 --- ovsdbapp/backend/ovs_idl/connection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ovsdbapp/backend/ovs_idl/connection.py b/ovsdbapp/backend/ovs_idl/connection.py index 808ec8c2..9ae84a9a 100644 --- a/ovsdbapp/backend/ovs_idl/connection.py +++ b/ovsdbapp/backend/ovs_idl/connection.py @@ -220,9 +220,13 @@ class OvsdbIdl(idl.Idl): self.cond_change(table, [False]) del self.tables[table] + try: + _tables = idl.IdlTable.schema_tables(self, schema) + except AttributeError: + _tables = None # add new tables as Idl.__init__ does for table in (schema.tables[table] for table in added): - self.tables[table.name] = table + self.tables[table.name] = _tables[table.name] if _tables else table for column in table.columns.values(): if not hasattr(column, 'alert'): column.alert = True