Change in vdsm[master]: BZ#732272 Activate nics in the correct order

Federico Simoncelli fsimonce at redhat.com
Mon Aug 22 21:24:51 UTC 2011


Federico Simoncelli has posted comments on this change.

Change subject: BZ#732272 Activate nics in the correct order
......................................................................


Patch Set 1: (2 inline comments)

....................................................
File vdsm/configNetwork.py
Line 110: def nicSort(nics):
because:
 >>> sorted(['eth1', 'eth2', 'eth10'])
 ['eth1', 'eth10', 'eth2']

Line 115:         nic_sre = re.match("([A-Za-z]+)([0-9]+)", nic_name)
I agree on the compiled regex but the cmp function for sort is much more complicated. You need implement and return 1, 0, -1 (if one of those is missing it won't sort properly). Moreover if you're going to index only by the numeric index you might end up with something like ['eth1', 'em1', 'eth2'] where the correct order (what is used at boot time) is instead ['em1', 'eth1', 'eth2'].

--
To view, visit http://gerrit.usersys.redhat.com/835
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If7048d01780d8e7dbb03a87b478b578ae34cb582
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo Warszawski <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list