Igor Lvovsky has uploaded a new change for review.

Change subject: Restart network service during restore backups
......................................................................

Restart network service during restore backups

Change-Id: I3d7357a75fc7fbe4af8d5e8654034367512698d1
Signed-off-by: Igor Lvovsky <[email protected]>
---
M vdsm/configNetwork.py
1 file changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/7144/1

diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index e86e0c7..f6f5130 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -278,15 +278,12 @@
 
     def restoreAtomicBackup(self):
         logging.info("Rolling back configuration (restoring atomic backup)")
-        if not self._backups:
-            return
         for confFile, content in self._backups.iteritems():
             if content is None:
                 utils.rmFile(confFile)
             else:
                 open(confFile, 'w').write(content)
             logging.info('Restored %s', confFile)
-        subprocess.Popen(['/etc/init.d/network', 'start'])
 
     @classmethod
     def _persistentBackup(cls, filename):
@@ -332,9 +329,20 @@
 
     def restoreBackups(self):
         """ Restore network backups """
+        if not self._backups and not self._networksBackups:
+            return
+
+        subprocess.Popen(['/etc/init.d/network', 'stop'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE).communicate()
+
         self.restoreAtomicNetworkBackup()
         self.restoreAtomicBackup()
 
+        subprocess.Popen(['/etc/init.d/network', 'start'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE).communicate()
+
     @classmethod
     def clearBackups(cls):
         """ Clear backup files """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d7357a75fc7fbe4af8d5e8654034367512698d1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to