Change in vdsm[ovirt-3.5]: net config: make sure ifcfg files are not persisted on node

danken at redhat.com danken at redhat.com
Sun Jan 18 08:54:17 UTC 2015


Hello Douglas Schilling Landgraf,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/37016

to review the following change.

Change subject: net config: make sure ifcfg files are not persisted on node
......................................................................

net config: make sure ifcfg files are not persisted on node

When setting up networking, a multitude of ifcfg files may be modified.
If we are using the (default) 'unified' persistence mode, we expect that
none of these modification is to be persisted for the next boot.

However already-persisted ifcfg files would; unpersisted files won't,
which lead to the inconsistent state reported in the bug.

In this patch we make sure that none of our changes to ifcfg files is to
be persisted.

Change-Id: Ia61b2385ce0bf44a67f627caf5b73b68992349fd
Bug-Url: https://bugzilla.redhat.com/1165203
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/36985
Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Tested-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M vdsm/network/configurators/ifcfg.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/37016/1

diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 5dbe9c1..87fd849 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -534,6 +534,11 @@
         writes the new configuration and sets the specified access mode.'''
         self._backup(fileName)
         configuration = self.CONFFILE_HEADER + '\n' + configuration
+
+        # make sure that ifcfg files are never persisted by the node
+        if self.unifiedPersistence and utils.isOvirtNode():
+            node_fs.Config().unpersist(fileName)
+
         logging.debug('Writing to file %s configuration:\n%s', fileName,
                       configuration)
         with open(fileName, 'w') as confFile:


-- 
To view, visit http://gerrit.ovirt.org/37016
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia61b2385ce0bf44a67f627caf5b73b68992349fd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>


More information about the vdsm-patches mailing list