Change in vdsm[master]: net: ifcfg: use unified rollback

phoracek at redhat.com phoracek at redhat.com
Tue Mar 1 14:04:29 UTC 2016


Petr Horáček has uploaded a new change for review.

Change subject: net: ifcfg: use unified rollback
......................................................................

net: ifcfg: use unified rollback

No matter if we use unified or ifcfg persistence, Ifcfg configurator
always use its own rollback based on restoring ifcfg files.

In order to support multiple NetSwitches we have to do one common
rollback which is not possible in this state.

This patch makes Ifcfg use unified rollback in case unified persistence
is set.

Change-Id: I0b0f8891eaf97648ea7fbde4e7d5cc855ce157e6
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M lib/vdsm/network/configurators/ifcfg.py
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/54217/1

diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py
index 395dd31..c81c19d 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -85,13 +85,14 @@
             self.runningConfig = RunningConfig()
 
     def rollback(self):
-        """This reimplementation always returns None since Ifcfg can rollback
-        on its own via restoreBackups(). This makes the general mechanism of
-        API.Global._rollback redundant in this case."""
-        self.configApplier.restoreBackups()
-        self.configApplier = None
         if self.unifiedPersistence:
-            self.runningConfig = None
+            super(Ifcfg, self).rollback()
+        else:
+            # When ifcfg persistence is used, it is not possible to use general
+            # unified rollback mechanism. In this case, we use Ifcfg rollback
+            # implementation via restoreBackups().
+            self.configApplier.restoreBackups()
+            self.configApplier = None
 
     def commit(self):
         self.configApplier = None


-- 
To view, visit https://gerrit.ovirt.org/54217
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b0f8891eaf97648ea7fbde4e7d5cc855ce157e6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list