2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 19:20:24 +00:00

Have xcoll take a try at sorting output groups (#4018)

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 21:36:30 -04:00
committed by yangsong
parent cf39880a20
commit 2d024b5aeb

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";