Blame SOURCES/BZ_1904889-do-not-remove-unmanaged-ovs-bridge.patch

f4af94
From d7393d40aaedeea5dd8291519cddeecdfdabc849 Mon Sep 17 00:00:00 2001
f4af94
From: Fernando Fernandez Mancera <ffmancera@riseup.net>
f4af94
Date: Mon, 7 Dec 2020 00:51:19 +0100
f4af94
Subject: [PATCH] ifaces: do not remove unmanaged orphan interfaces
f4af94
f4af94
If there are unmanaged OVS interface present in the network state, NM
f4af94
may report uncomplete information. Therefore, nmstate could consider
f4af94
them as orphan and remove it when modifying the network state.
f4af94
f4af94
In order to fix this, nmstate should not consider it orphan and remove
f4af94
it when it is not on desired state or marked as changed.
f4af94
f4af94
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
f4af94
Signed-off-by: Gris Ge <fge@redhat.com>
f4af94
---
f4af94
 libnmstate/ifaces/ifaces.py | 6 ++++--
f4af94
 1 file changed, 4 insertions(+), 2 deletions(-)
f4af94
f4af94
diff --git a/libnmstate/ifaces/ifaces.py b/libnmstate/ifaces/ifaces.py
f4af94
index 1c2ffd5..703e672 100644
f4af94
--- a/libnmstate/ifaces/ifaces.py
f4af94
+++ b/libnmstate/ifaces/ifaces.py
f4af94
@@ -242,8 +242,10 @@ class Ifaces:
f4af94
 
f4af94
     def _mark_orphen_as_absent(self):
f4af94
         for iface in self._ifaces.values():
f4af94
-            if iface.need_parent and (
f4af94
-                not iface.parent or not self._ifaces.get(iface.parent)
f4af94
+            if (
f4af94
+                iface.need_parent
f4af94
+                and (not iface.parent or not self._ifaces.get(iface.parent))
f4af94
+                and (iface.is_desired or iface.is_changed)
f4af94
             ):
f4af94
                 iface.mark_as_changed()
f4af94
                 iface.state = InterfaceState.ABSENT
f4af94
-- 
f4af94
2.18.4
f4af94