Blame SOURCES/BZ_1966457_Fix_bond_fail_over_mac.patch

1797a9
From b1e94d1aa04f51b2d15711c8e7ab37198b173065 Mon Sep 17 00:00:00 2001
1797a9
From: Gris Ge <fge@redhat.com>
1797a9
Date: Tue, 1 Jun 2021 16:33:15 +0800
1797a9
Subject: [PATCH] bond: Fix bond fail_over_mac=active
1797a9
1797a9
With bond interface in fail_over_mac=active and active-backup mode,
1797a9
any future change via nmstate will fail as nmstate is validating
1797a9
on current state instead of desire state for this bond mac restriction.
1797a9
1797a9
Fixed the code to only validate bond mac restriction on desired or
1797a9
changed bond interface.
1797a9
1797a9
Integration test case include.
1797a9
1797a9
Signed-off-by: Gris Ge <fge@redhat.com>
1797a9
---
1797a9
 libnmstate/ifaces/bond.py | 2 +-
1797a9
 1 file changed, 1 insertion(+), 1 deletion(-)
1797a9
1797a9
diff --git a/libnmstate/ifaces/bond.py b/libnmstate/ifaces/bond.py
1797a9
index 138386e..01859b0 100644
1797a9
--- a/libnmstate/ifaces/bond.py
1797a9
+++ b/libnmstate/ifaces/bond.py
1797a9
@@ -88,7 +88,7 @@ class BondIface(BaseIface):
1797a9
 
1797a9
     def pre_edit_validation_and_cleanup(self):
1797a9
         super().pre_edit_validation_and_cleanup()
1797a9
-        if self.is_up:
1797a9
+        if self.is_up and (self.is_desired or self.is_changed):
1797a9
             self._discard_bond_option_when_mode_change()
1797a9
             self._validate_bond_mode()
1797a9
             self._fix_mac_restriced_mode()
1797a9
-- 
1797a9
2.31.1
1797a9