Change in vdsm[master]: network: do not try to clean running configuration

ibarkan at redhat.com ibarkan at redhat.com
Tue May 5 11:13:56 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: network: do not try to clean running configuration
......................................................................

network: do not try to clean running configuration

This small optimization was also the behavior before this change,
only now it is easier to read and is also logged.

Change-Id: If8c0062e3d0c3625311876ef740b15577bf8a16e
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M vdsm/vdsm-restore-net-config
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/40537/1

diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 0c60732..eb19a1a 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -69,6 +69,10 @@
 
 def _remove_networks_in_running_config():
     runningConfig = RunningConfig()
+    if not runningConfig:
+        logging.debug("not cleanning running configuration since it is empty.")
+        return
+
     removeNetworks = {}
     removeBonds = {}
     for network in runningConfig.networks:
@@ -77,9 +81,8 @@
         removeBonds[bond] = {'remove': True}
     logging.debug('Removing all networks (%s) and bonds (%s) in running '
                   'config.', removeNetworks, removeBonds)
-    if removeNetworks or removeBonds:
-        setupNetworks(removeNetworks, removeBonds, connectivityCheck=False,
-                      _inRollback=True)
+    setupNetworks(removeNetworks, removeBonds, connectivityCheck=False,
+                  _inRollback=True)
 
 
 def _flush_configurators_leftovers():


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8c0062e3d0c3625311876ef740b15577bf8a16e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list