Change in vdsm[master]: network: api: destroy on master removal misunderstanding

phoracek at redhat.com phoracek at redhat.com
Thu Feb 12 14:28:17 UTC 2015


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

Change subject: network: api: destroy on master removal misunderstanding
......................................................................

network: api: destroy on master removal misunderstanding

According to network configurators, bonding's parameter
destroyOnMasterRemoval set to True means 'remove bonding's slaves with
bond'.

Problem is, that in network/api.py we always set it to True on bond's
removal and thus it never preserves slaves alive.

Now the parameter is get from bond's options. Probably we should change
default value of destroyOnMasterRemoval to True, so the functionality
would stay the same (???).

Change-Id: Iaf76f1cf15e2ad3977534a5ada21adf824b235e7
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M vdsm/network/api.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/37754/1

diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index ad4e64e..c2903cf 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -588,7 +588,8 @@
             bond = Bond.objectivize(name, configurator, attrs.get('options'),
                                     attrs.get('nics'), mtu=None,
                                     _netinfo=_netinfo,
-                                    destroyOnMasterRemoval='remove' in attrs)
+                                    destroyOnMasterRemoval=attrs.get(
+                                        'destroyOnMasterRemoval'))
             bond.remove()
             del _netinfo.bondings[name]
         elif name in _netinfo.bondings:
@@ -599,7 +600,8 @@
     def _getBondObject():
         bond = Bond.objectivize(name, configurator, attrs.get('options'),
                                 attrs.get('nics'), mtu=None, _netinfo=_netinfo,
-                                destroyOnMasterRemoval='remove' in attrs)
+                                destroyOnMasterRemoval=attrs.get(
+                                    'destroyOnMasterRemoval'))
         if len(bond.slaves) == 0:
             raise ConfigNetworkError(ne.ERR_BAD_PARAMS, 'Missing required nics'
                                      ' for bonding device.')


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

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