Change in vdsm[master]: net: removing the bonding modes constant duplication.
danken at redhat.com
danken at redhat.com
Sun Nov 29 10:53:13 UTC 2015
Dan Kenigsberg has posted comments on this change.
Change subject: net: removing the bonding modes constant duplication.
......................................................................
Patch Set 4: Code-Review-1
(2 comments)
https://gerrit.ovirt.org/#/c/49170/4/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:
Line 102: iteritems())
please use
six.iteritems()
in new code.
https://gerrit.ovirt.org/#/c/49170/4/vdsm/network/models.py
File vdsm/network/models.py:
Line 320: raise ConfigNetworkError(ne.ERR_BAD_BONDING, 'Error parsing '
Line 321: 'bonding options: %r' % bondingOptions)
Line 322:
Line 323: if mode in netinfo.BONDING_MODES_NAME_TO_NUMBER:
Line 324: mode = netinfo.BONDING_MODES_NAME_TO_NUMBER[mode]
> or maybe 'mode = netinfo.BONDING_MODES_NAME_TO_NUMBER.get(mode) or mode'
short-circuit logic can be nice some time, but I don't see its benefit here. Better keep Ido's current suggestion.
Line 325: defaults = netinfo.getDefaultBondingOptions(mode)
Line 326:
Line 327: for option in bondingOptions.split():
Line 328: key, _ = option.split('=', 1)
--
To view, visit https://gerrit.ovirt.org/49170
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia6682c7294f5afb8d50a30c6bd0431d85bbd159d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan 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