From c10df5f8acca05a9fe28887a7351189b67a6ba15 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 23:40:18 +0000 Subject: Apply patch BZ_1869345_ovsdb_remove_all_ports.patch patch_name: BZ_1869345_ovsdb_remove_all_ports.patch present_in_specfile: true location_in_specfile: 8 --- diff --git a/libnmstate/plugins/nmstate_plugin_ovsdb.py b/libnmstate/plugins/nmstate_plugin_ovsdb.py index 12ab10d..f667e8f 100644 --- a/libnmstate/plugins/nmstate_plugin_ovsdb.py +++ b/libnmstate/plugins/nmstate_plugin_ovsdb.py @@ -222,19 +222,11 @@ class NmstateOvsdbPlugin(NmstatePlugin): def _db_write(self, changes): changes_index = {change.row_name: change for change in changes} changed_tables = set(change.table_name for change in changes) - updated_names = [] for changed_table in changed_tables: for row in self._idl.tables[changed_table].rows.values(): if row.name in changes_index: change = changes_index[row.name] setattr(row, change.column_name, change.column_value) - updated_names.append(change.row_name) - new_rows = set(changes_index.keys()) - set(updated_names) - if new_rows: - raise NmstatePluginError( - f"BUG: row {new_rows} does not exists in OVS DB " - "and currently we don't create new row" - ) def _start_transaction(self): self._transaction = Transaction(self._idl)