2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-03-15 16:07:47 +00:00

Have nodeattrib output be sorted

This make nodelist and nodeattrib output much easier to follow.
This commit is contained in:
Jarrod Johnson 2018-11-29 10:02:37 -05:00
parent 53996a1e9d
commit 853585f942

View File

@ -100,7 +100,7 @@ def retrieve_nodegroup(nodegroup, element, configmanager, inputdata):
def retrieve_nodes(nodes, element, configmanager, inputdata):
attributes = configmanager.get_node_attributes(nodes)
if element[-1] == 'all':
for node in nodes:
for node in util.natural_sort(nodes):
theattrs = set(allattributes.node).union(set(attributes[node]))
for attribute in sorted(theattrs):
if attribute in attributes[node]: # have a setting for it
@ -125,7 +125,7 @@ def retrieve_nodes(nodes, element, configmanager, inputdata):
allattributes.node.get(
attribute, {}).get('description', ''))
elif element[-1] == 'current':
for node in sorted(list(attributes)):
for node in util.natural_sort(list(attributes)):
for attribute in sorted(attributes[node].iterkeys()):
currattr = attributes[node][attribute]
try: