From fb3869525ab3f81a5571e5d9146da53adecdbd73 Mon Sep 17 00:00:00 2001 From: jjhua Date: Tue, 28 Feb 2012 05:31:43 +0000 Subject: [PATCH] fixed bug 3491152, call all_lpars_state firstly, for the node which couldn't be queried, call the stat again. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11702 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPpower.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/FSPpower.pm b/perl-xCAT/xCAT/FSPpower.pm index 0c0e2e9bd..bf6b35d79 100644 --- a/perl-xCAT/xCAT/FSPpower.pm +++ b/perl-xCAT/xCAT/FSPpower.pm @@ -386,8 +386,20 @@ sub state { # Node not found ################################## if ( !exists( $data->{$id} )) { - push @result, [$name, $prefix."Node not found",1]; - next; + my $res = xCAT::FSPUtils::fsp_api_action($name, $d, "state"); + my $rc = @$res[2]; + my $val = @$res[1]; + if( $rc != 0) { + push @result, [$name, $prefix.$val,1]; + } + + if( !defined($val) || $val =~ /^error$/ ) { + push @result, [$name, $prefix."Node not found",1]; + next; + } else { + $data->{$id} = $val; + } + } ################################## # Output value