2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Make rinv output sorted deterministically

The numeric sort was throwing up it's hands on pure text
keys.  Fix by adding an 'or cmp' to try string comparison
if numerical sort counts them as equal.
This commit is contained in:
Jarrod Johnson
2017-08-28 10:49:36 -04:00
parent e7870abec9
commit 9cd3fac668

View File

@@ -2959,7 +2959,7 @@ sub fru_initted {
my @types = @{ $sessdata->{invtypes} };
my $format = "%-20s %s";
foreach $key (sort { $a <=> $b } keys %{ $sessdata->{fru_hash} }) {
foreach $key (sort { $a <=> $b or $a cmp $b } keys %{ $sessdata->{fru_hash} }) {
my $fru = $sessdata->{fru_hash}->{$key};
my $type;
foreach $type (split /,/, $fru->rec_type) {