Ignore link info when sorting links.

This commit is contained in:
Bob Lantz
2014-11-03 14:20:01 -08:00
parent 634761b8a7
commit 8dea57d271
+5 -1
View File
@@ -203,7 +203,11 @@ class Topo( object ):
withInfo: return link info withInfo: return link info
returns: list of ( src, dst [,key, info ] )""" returns: list of ( src, dst [,key, info ] )"""
links = list( self.iterLinks( withKeys, withInfo ) ) links = list( self.iterLinks( withKeys, withInfo ) )
return links if not sort else self.sorted( links ) if not sorted:
return links
# Ignore info when sorting
tupleSize = 3 if withKeys else 2
return sorted( links, key=( lambda l: naturalSeq( l[ 0 : tupleSize ] ) ) )
# This legacy port management mechanism is clunky and will probably # This legacy port management mechanism is clunky and will probably
# be removed at some point. # be removed at some point.