Merge pull request #671 from hpcng/SortNetnames

sort netnames for node list
This commit is contained in:
Jonathon Anderson
2023-02-02 20:56:45 -07:00
committed by GitHub

View File

@@ -36,6 +36,7 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro
for k := range n.NetDevs {
netNames = append(netNames, k)
}
sort.Strings(netNames)
nodeList.Output = append(nodeList.Output,
fmt.Sprintf("%-22s %-26s %s", n.Id.Print(), n.Profiles.Print(), strings.Join(netNames, ", ")))
}