Compare commits

...

2 Commits

Author SHA1 Message Date
90e515c46f Always sort VM list
Same justification as previous commit.
2022-08-09 12:05:40 -04:00
a6a5f71226 Ensure the node list is sorted
Otherwise the node entries could come back in an arbitrary order; since
this is an ordered list of dictionaries that might not be expected by
the API consumers, so ensure it's always sorted.
2022-08-09 12:03:49 -04:00
2 changed files with 2 additions and 0 deletions

View File

@ -236,6 +236,7 @@ def get_list(
): ):
node_list = [] node_list = []
full_node_list = zkhandler.children("base.node") full_node_list = zkhandler.children("base.node")
full_node_list.sort()
if is_fuzzy and limit: if is_fuzzy and limit:
# Implicitly assume fuzzy limits # Implicitly assume fuzzy limits

View File

@ -1193,6 +1193,7 @@ def get_list(zkhandler, node, state, tag, limit, is_fuzzy=True, negate=False):
return False, 'VM state "{}" is not valid.'.format(state) return False, 'VM state "{}" is not valid.'.format(state)
full_vm_list = zkhandler.children("base.domain") full_vm_list = zkhandler.children("base.domain")
full_vm_list.sort()
# Set our limit to a sensible regex # Set our limit to a sensible regex
if limit: if limit: