2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Natural sort of group names when collection queried

Keeping with the theme of natural sort, apply it to '/nodegroups/' requests.
This commit is contained in:
Jarrod Johnson 2015-03-25 10:01:44 -04:00
parent 1c6430bf3f
commit d53c4dce58

View File

@ -317,7 +317,12 @@ def handle_nodegroup_request(configmanager, inputdata,
if operation == "create":
inputdata = msg.InputAttributes(pathcomponents, inputdata)
create_group(inputdata.attribs, configmanager)
return iterate_collections(configmanager.get_groups())
allgroups = list(configmanager.get_groups())
try:
allgroups.sort(key=noderange.humanify_nodename)
except TypeError:
allgroups.sort()
return iterate_collections(allgroups)
elif len(pathcomponents) == 2:
iscollection = True
else: