2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-05 17:58:14 +00:00

Provide error message should fping be missing

This commit is contained in:
Jarrod Johnson
2018-01-29 16:12:50 -05:00
parent 3ce4d81b36
commit f0c881820d

View File

@@ -797,7 +797,9 @@ sub process_request_port {
my $node;
my $fping;
open($fping, "fping " . join(' ', @nodes) . " 2> /dev/null|") or die("Can't start fping: $!");
my $havefping = 0;
while (<$fping>) {
$havefping = 1;
my %rsp;
my $node = $_;
$node =~ s/ .*//;
@@ -810,6 +812,12 @@ sub process_request_port {
$status->{$node}->{'status'} = "nosuchhost";
}
}
unless ($havefping) {
my $rsp = {};
$rsp->{error}->[0] =
"Unable to find fping on system, must install fping package to use nodestat -f";
xCAT::MsgUtils->message("E", $rsp, $callback, 1);
}
}
return $status;