Interfaces are sorted in get_facts
This commit is contained in:
1 parent
0dd1c3c1d2
commit
a3b1634f2d
1 file changed
+8
@@ -1,3 +1,11 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def sorted_nicely( l ):
|
||||||
|
""" Sort the given iterable in the way that humans expect."""
|
||||||
|
convert = lambda text: int(text) if text.isdigit() else text
|
||||||
|
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
|
||||||
|
return sorted(l, key = alphanum_key)
|
||||||
|
|
||||||
def colon_separated_string_to_dict(string, separator=':'):
|
def colon_separated_string_to_dict(string, separator=':'):
|
||||||
'''
|
'''
|
||||||
Converts a string in the format:
|
Converts a string in the format:
|
||||||
|
|||||||
Reference in new issue
Block a user