Salt will pick the first name on the current default interface to determine
the hostname of the machine. Since we are sorting with all entries for each
machine there's a high change that a salt minion id will win the first position,
affecting certain grains that we use to determine the hostname of the node.
With this change we are not only sorting alphabetically by the name of each column
in each entry, but also adding weight to each column on each entry. This means that
the nodename will always win, as its primary weight will be lower than the rest,
while the second sorting strategy is purely alphabetical.
Salt will pick the first name on the current default interface to determine the hostname of the machine. Since we are sorting with all entries for each machine there's a high change that a salt minion id will win the first position, affecting certain grains that we use to determine the hostname of the node.
With this change we are not only sorting alphabetically by the name of each column in each entry, but also adding weight to each column on each entry. This means that the nodename will always win, as its primary weight will be lower than the rest, while the second sorting strategy is purely alphabetical.
Fixes: bsc#1117339