diff --git a/SOURCES/BZ_1869345_ovsdb_remove_all_ports.patch b/SOURCES/BZ_1869345_ovsdb_remove_all_ports.patch new file mode 100644 index 0000000..e1a1ac3 --- /dev/null +++ b/SOURCES/BZ_1869345_ovsdb_remove_all_ports.patch @@ -0,0 +1,44 @@ +From 913b739c8fea8e9b14d3785371c8e4f48723dbd6 Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Tue, 18 Aug 2020 17:55:12 +0800 +Subject: [PATCH] ovsdb: Allowing remove all ports from OVS bridge + +When removing all ports from OVS bridge, the OVSDB will have no +information regarding this bridge, which cause OVSDB failed to find +the correct row. + +Silently ignore row not found failure and let verification stage do the +work. + +Signed-off-by: Gris Ge +--- + libnmstate/plugins/nmstate_plugin_ovsdb.py | 8 -------- + 1 file changed, 8 deletions(-) + +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) +-- +2.28.0 + diff --git a/SPECS/nmstate.spec b/SPECS/nmstate.spec index 8abf6d2..98f1636 100644 --- a/SPECS/nmstate.spec +++ b/SPECS/nmstate.spec @@ -4,7 +4,7 @@ Name: nmstate Version: 0.3.4 -Release: 10%{?dist} +Release: 12%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} @@ -18,6 +18,7 @@ Patch4: BZ_1862025-remove_existing_profiles.patch Patch5: BZ_1858758-fix_ovs_bond.patch Patch6: BZ_1859844-fix_converting_memory_only.patch Patch7: BZ_1866269-preserve_nm_uuid_in_ovsdb.patch +Patch8: BZ_1869345_ovsdb_remove_all_ports.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -88,6 +89,12 @@ gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_ovsdb* %changelog +* Tue Aug 18 2020 Gris Ge - 0.3.4-12 +- New patch: OVSDB: Allowing remove all OVS ports. RHBZ#1869345 + +* Tue Aug 18 2020 Gris Ge - 0.3.4-11 +- OVSDB: Allowing remove all OVS ports. RHBZ#1869345 + * Thu Aug 06 2020 Gris Ge - 0.3.4-10 - OVSDB: Preserv old external_ids. RHBZ#1866269