Change in vdsm[master]: configNetwork: improve assertBridgeClean

danken at redhat.com danken at redhat.com
Thu Feb 28 20:53:14 UTC 2013


Dan Kenigsberg has posted comments on this change.

Change subject: configNetwork: improve assertBridgeClean
......................................................................


Patch Set 2: (2 inline comments)

thanks! these "except: pass" were evil.

....................................................
File vdsm/configNetwork.py
Line 989: 
Line 990: 
Line 991: def assertBridgeClean(bridge, vlan, bonding, nics):
Line 992:     ports = set(netinfo.ports(bridge))
Line 993:     brifs = set(nics)
"brifs" (meaning bridge interfaces) are not such a good name for this set that holds unrelated nics as well. "ifaces" is better.
Line 994:     if vlan:
Line 995:         brifs.add((bonding or nics[0]) + '.' + vlan)
Line 996:     else:
Line 997:         brifs.add(bonding)


Line 995:         brifs.add((bonding or nics[0]) + '.' + vlan)
Line 996:     else:
Line 997:         brifs.add(bonding)
Line 998: 
Line 999:     brifs = list(ports - brifs)
there is no need to convert this set to list.

 if ports - ifaces:

is good and clear enough.
Line 1000: 
Line 1001:     if brifs:
Line 1002:         raise ConfigNetworkError(ne.ERR_USED_BRIDGE, 'bridge %s has interfaces'
Line 1003:                                  ' %s connected' % (bridge, brifs))


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I44b28e16d20e993c84d0569db7c661e18d432ce7
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Hunt Xu <mhuntxu at gmail.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Hunt Xu <mhuntxu at gmail.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list