Skip to content

Commit

Permalink
shaper: sort numerically, not alphabethically
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jan 21, 2017
1 parent 21be9fa commit 98333c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/opnsense/service/modules/addons/template_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
package : configd
"""

from operator import itemgetter
import netaddr


Expand Down Expand Up @@ -85,7 +84,7 @@ def toList(self, tag, sortBy=None):
return result
else:
# resort list by tag
return sorted(result, key=itemgetter(sortBy))
return sorted(result, key=lambda d: int(d[sortBy]))

def getUUIDtag(self, uuid):
""" retrieve tag name of registered uuid, returns __not_found__ if none available
Expand Down

0 comments on commit 98333c1

Please sign in to comment.