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

Have xcoll take a try at sorting output groups

It isn't natural sort, but in many cases it should work.

Natural sort in perl is a pain or a dependency.
This commit is contained in:
Jarrod Johnson
2017-09-27 15:34:26 -04:00
parent 44b47c4495
commit c5aa4c1d38

View File

@@ -8,6 +8,7 @@ use xCAT::Client;
use Getopt::Long;
use strict;
my %output;
my %outputhdrs;
my $option;
my $printcount;
@@ -45,7 +46,7 @@ sub fillerup {
}
}
if ($individual) {
foreach my $node (keys %output) {
foreach my $node (sort { $a <=> $b or $a cmp $b } keys %output) {
print "====================================\n";
print "$node\n";
print "====================================\n";
@@ -63,6 +64,11 @@ foreach my $output (keys %collated) {
unless ($option) {
xCAT::Client::submit_request($cmdref, \&fillerup);
}
$outputhdrs{$nodes} = $output;
}
foreach my $hdr (sort { $a <=> $b or $a cmp $b } keys %outputhdrs) {
$nodes = $hdr;
my $output = $outputhdrs{$hdr};
print "====================================\n";
print "$nodes\n";
print "====================================\n";