From c1043910cf55dd7d3a8e5eaf598c9be9a65cb289 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 6 Oct 2008 19:32:22 +0000 Subject: [PATCH] fix -v option in dsh git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2289 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 7 ++++++- perl-xCAT/xCAT/DSHCore.pm | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 357e6bba6..5d3d728cc 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -4008,7 +4008,12 @@ sub runDsh_api $::DSH_API_MESSAGE = ""; my $verbose_old = $::VERBOSE; $::VERBOSE = 0; + # + # execute dsh + # + $::RUNCMD_RC=0; $::RUNCMD_RC = xCAT::DSHCLI->execute_dsh($optionsRef); + $::DSH_API = 0; $::VERBOSE = $verbose_old; my $returnCode; #command will exit with this code @@ -4045,7 +4050,7 @@ sub runDsh_api { $errmsg = $::DSH_API_MESSAGE; } - if (!$DSHCLI::NO_MESSAGES) + if ((!$DSHCLI::NO_MESSAGES) && ($::DSH_API_NODES_FAILED)) { xCAT::MsgUtils->message( "E", diff --git a/perl-xCAT/xCAT/DSHCore.pm b/perl-xCAT/xCAT/DSHCore.pm index 9252201ce..82df0cdf3 100644 --- a/perl-xCAT/xCAT/DSHCore.pm +++ b/perl-xCAT/xCAT/DSHCore.pm @@ -724,16 +724,17 @@ sub pping_hostnames my $hostname_list = join ",", @hostnames; my @output = - xCAT::Utils->runcmd("pping -H $hostname_list", -1); - + xCAT::Utils->runcmd("pping $hostname_list", -1); + $::RUNCMD_RC =0; # reset my @no_response = (); foreach my $line (@output) { my ($hostname, $result) = split ':', $line; my ($token, $status) = split ' ', $result; chomp($token); - !(($token eq 'ping') && ($status eq '(alive)')) - && (push @no_response, $hostname); + if ($token ne 'ping') { + push @no_response, $hostname; + } } return @no_response;