Change in vdsm[master]: net: api: remove bonding handling from _addNetwork

danken at redhat.com danken at redhat.com
Fri Feb 12 19:30:21 UTC 2016


Dan Kenigsberg has posted comments on this change.

Change subject: net: api: remove bonding handling from _addNetwork
......................................................................


Patch Set 8: Code-Review-1

(5 comments)

a pretty cleanup, but I think that it can be simplified and broken to more consistent easily-reviewable patches.

https://gerrit.ovirt.org/#/c/53475/8/lib/vdsm/network/api.py
File lib/vdsm/network/api.py:

Line 673: 
I'm not sure yet if dropping the explicit mtu=None from here is a great idea. but clearly it is not a required part of this patch.


Line 87: persistence = _getPersistenceModule()
Line 88: 
Line 89: 
Line 90: def _objectivizeNetwork(bridge=None, vlan=None, vlan_id=None, bonding=None,
Line 91:                         nic=None, mtu=None, ipaddr=None, netmask=None,
if possible, do not move unrelated args
Line 92:                         gateway=None, bootproto=None, ipv6addr=None,
Line 93:                         ipv6gateway=None, ipv6autoconf=None, dhcpv6=None,
Line 94:                         defaultRoute=None, _netinfo=None, configurator=None,
Line 95:                         blockingdhcp=None, implicitBonding=None, opts=None):


Line 703:     if topNetDev:
Line 704:         topNetDev.remove()
Line 705: 
Line 706: 
Line 707: def _check_bonding_availability(bond, bonds, _netinfo):
# network's bond must be a newly-built bonds or previously-existing ones

(doesn't "bonds" include bonds to be removed as well?)
Line 708:     if bond not in bonds and bond not in _netinfo.bondings:
Line 709:         raise ConfigNetworkError(
Line 710:             ne.ERR_BAD_PARAMS, 'Bond %s does not exist' % bond)
Line 711: 


Line 733:         except ConfigNetworkError as cne:
Line 734:             if cne.errCode == ne.ERR_FAILED_IFUP:
Line 735:                 logger.debug("Adding network %r failed. Running "
Line 736:                              "orphan-devices cleanup", network)
Line 737:                 _emergencyNetworkCleanup(network, attrs, configurator)
whitespace is not expensive. redundant changes in a diff are.
Line 738:             raise
Line 739: 
Line 740:         _netinfo.updateDevices()  # Things like a bond mtu can change
Line 741: 


https://gerrit.ovirt.org/#/c/53475/8/lib/vdsm/network/models.py
File lib/vdsm/network/models.py:

Line 276: _netinfo
making _netinfo a compulsory argument is a noble cause. so noble that it begs for its own patch (to make sure we do not confuse it with other changes)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I20c79bc8e3d8a0db5e814ad91fa9fcf8ca71be04
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list