sort netnames for node list

This commit is contained in:
Christian Goll
2023-02-01 11:10:51 +01:00
parent cb1726bd40
commit 0a8638698d

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, ", ")))
}