Petr Horáček has uploaded a new change for review. Change subject: network: api: remove bond objectivization duplicated code ......................................................................
network: api: remove bond objectivization duplicated code Change-Id: Ie0dd75fa37a687dcd9b32519e075cf3efc7aa08e Signed-off-by: Petr Horáček <[email protected]> --- M vdsm/network/api.py 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/37750/1 diff --git a/vdsm/network/api.py b/vdsm/network/api.py index 0f74f47..7f418a9 100755 --- a/vdsm/network/api.py +++ b/vdsm/network/api.py @@ -596,16 +596,18 @@ else: addition.append((name, attrs)) - for name, attrs in edition: + def _getBondObject(): bond = Bond.objectivize(name, configurator, attrs.get('options'), attrs.get('nics'), mtu=None, _netinfo=_netinfo, destroyOnMasterRemoval='remove' in attrs) + return bond + + for name, attrs in edition: + bond = _getBondObject() logger.debug("Editing bond %r with options %s", bond, bond.options) configurator.editBonding(bond, _netinfo) for name, attrs in addition: - bond = Bond.objectivize(name, configurator, attrs.get('options'), - attrs.get('nics'), mtu=None, _netinfo=_netinfo, - destroyOnMasterRemoval='remove' in attrs) + bond = _getBondObject() logger.debug("Creating bond %r with options %s", bond, bond.options) configurator.configureBond(bond) -- To view, visit http://gerrit.ovirt.org/37750 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0dd75fa37a687dcd9b32519e075cf3efc7aa08e Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Petr Horáček <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
