Complete nodestat feature, still pending: parallelized

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@577 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-26 14:25:58 +00:00
parent 0bf25aba93
commit e375bdf7f7

View File

@ -2,6 +2,7 @@ package xCAT_plugin::nodestat;
use Socket;
use IO::Handle;
my $stat;
sub handled_commands {
return {
@ -52,12 +53,16 @@ sub installer_query {
}
sub getstat {
my $response = shift;
$stat = $response->{node}->[0]->{data}->[0];
}
sub process_request {
my $request = shift;
my $callback = shift;
my $doreq = shift;
my @nodes = @{$request->{node}};
my $node;
foreach $node (@nodes) {
@ -82,7 +87,11 @@ sub process_request {
$callback->({node=>[\%rsp]});
next;
} else {
$rsp{data} = [ 'ping' ];
$doreq->({command=>['nodeset'],
node=>[$node],
arg=>['stat']},
\&getstat);
$rsp{data} = [ 'ping '.$stat ];
$callback->({node=>[\%rsp]});
next;
}