Giuseppe Vallarelli has posted comments on this change.
Change subject: Improve the checking of mulitple direct users on an interface.
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File lib/vdsm/netinfo.py
Line 605: if iface == vdict['iface']:
Line 606: users.add(v)
Line 607: return users
Line 608:
Line 609: def ifaceHasMultiUsers(self, iface):
I would reverse the check instead of ifaceHasMultiUsers I would use ifaceHasOneOrZeroUsers
(or a better name) because in netinfo you check for this using not. I find it more
readable having conditions exp without not.
Line 610: """
Line 611: Checks if the interface has multiple direct users.
Line 612: The two possible cases of mulitple users are multiple bridged or
Line 613: bridgeless networks via vlans and one direct bridgeless network
Line 614: with multiple network users via vlan.
Line 615: The interface can't have multiple direct users if it's enslaved
Line 616: to bonding or bridge directly.
Line 617: """
Line 618: return len(list(self.getNetworksAndVlansForIface(iface))) > 1
Perhaps this should be >= 1, but I'm not sure, in that case I would rename it to
ifaceHasUsers or ifaceIsUsed.
--
To view, visit
http://gerrit.ovirt.org/14872
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1e8bc4d8ee8709f72a5746edc2d61f320ef1a2ab
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>