Change in vdsm[master]: no need to call setupNetworks with empty argument during net...

ibarkan at redhat.com ibarkan at redhat.com
Sun Mar 15 11:32:55 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: no need to call setupNetworks with empty argument during network restoration
......................................................................

no need to call setupNetworks with empty argument during network restoration

It is not smart to trust setupNetwork implementation so that it is really a
no-op when called with empty input.

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


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/38745/1

diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 91a21b3..7e661b5 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -55,8 +55,9 @@
         removeBonds[bond] = {'remove': True}
     logging.debug('Removing all networks (%s) and bonds (%s) in running '
                   'config.', removeNetworks, removeBonds)
-    setupNetworks(removeNetworks, removeBonds, connectivityCheck=False,
-                  _inRollback=True)
+    if removeNetworks or removeBonds:
+        setupNetworks(removeNetworks, removeBonds, connectivityCheck=False,
+                      _inRollback=True)
 
     # Flush vdsm configurations left-overs from any configurator on the system
     # so that changes of configurator and persistence system are smooth.
@@ -72,7 +73,8 @@
                                      persistentConfig.bonds)
     logging.debug('Calling setupNetworks with networks (%s) and bond (%s).',
                   nets, bonds)
-    setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
+    if nets or bonds:
+        setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
 
 
 def _filter_nets_bonds(nets, bonds):


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

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