Change in vdsm[master]: network: store non-vdsm ifcfgs with unified persistence

phoracek at redhat.com phoracek at redhat.com
Mon Feb 2 14:08:18 UTC 2015


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

Change subject: network: store non-vdsm ifcfgs with unified persistence
......................................................................

network: store non-vdsm ifcfgs with unified persistence

Change-Id: Iaac0d82863334238e6db71b4a6a4f6b76a260223
Bug-Url: https://bugzilla.redhat.com/1188251
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M vdsm/network/configurators/ifcfg.py
M vdsm/vdsm-restore-net-config
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/37453/1

diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 65e02b5..efc2507 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -362,6 +362,17 @@
         self._atomicBackup(filename)
         if config.get('vars', 'net_persistence') != 'unified':
             self._persistentBackup(filename)
+        else:
+            # Backup non-VDSM network devices (BZ#1188251)
+            try:
+                with open(filename, 'r') as f:
+                    if 'Generated by VDSM' not in f.readline():
+                        self._persistentBackup(filename)
+            except IOError as e:
+                if e.errno == os.errno.ENOENT:
+                    pass
+                else:
+                    raise
 
     def _atomicBackup(self, filename):
         """
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index f9ca589..5ff1415 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -62,6 +62,10 @@
     for configurator_cls in _get_all_configurators():
         configurator_cls().flush()
 
+    # Restore non-VDSM network devices (BZ#1188251)
+    configWriter = ifcfg.ConfigWriter()
+    configWriter.restorePersistentBackup()
+
     persistentConfig = PersistentConfig()
     nets, bonds = _filter_nets_bonds(persistentConfig.networks,
                                      persistentConfig.bonds)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaac0d82863334238e6db71b4a6a4f6b76a260223
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