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

[xCAT-client]xdshbak: Use version sorting on hostnames

This commit is contained in:
Samveen Gulati
2016-10-10 15:12:57 +00:00
parent 7fcfc0700b
commit ccd0ff64f5
2 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,9 @@ use xCAT::MsgUtils;
use xCAT::DSHCLI;
use locale;
use Getopt::Std;
eval "use Sort::Versions qw/versioncmp/; 1;" or *versioncmp = sub ($$) { ($a,$b)= @_ ; return $a cmp $b };
#####################################################################
# #
# Module: xdshbak #
@ -231,7 +234,7 @@ sub print_list
local (@lines, $numhosts, $hn_string, $l_string);
foreach $hostname (sort @hs)
foreach $hostname (sort { versioncmp($a, $b) } @hs)
{
if (!$::opt_x) { ($num_hosts >= 1) && print "\n"; }
$num_hosts++;
@ -297,7 +300,7 @@ sub print_tree
($num_hosts >= 1) && print "\n";
$num_hosts++;
@wc = split(/:/, $hdr{$index});
@wc = sort(@wc);
@wc = sort { versioncmp($a, $b) } @wc;
#system "$SPMSG DSH $MSGCAT INFO511 'HOSTS '";
xCAT::MsgUtils->message("I",

View File

@ -8,5 +8,6 @@ Standards-Version: 3.7.2
Package: xcat-client
Architecture: all
Depends: ${perl:Depends}, nmap, perl-xcat
Recommends: libsort-versions-perl
Description: Core executables and data of the xCAT management project
xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters.