From c18b4d630de90f3d90430460b8d829022c8a4707 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Tue, 13 Mar 2012 04:31:58 +0000 Subject: [PATCH] modify the output of rpower blade state git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@11834 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPpower.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/FSPpower.pm b/perl-xCAT/xCAT/FSPpower.pm index 741b5fcdb..1c157e322 100644 --- a/perl-xCAT/xCAT/FSPpower.pm +++ b/perl-xCAT/xCAT/FSPpower.pm @@ -61,7 +61,14 @@ sub enumerate { ############################## # No lparid for fsp/bpa ############################## - if ( $type =~ /^(fsp|bpa|cec|frame)$/ ) { + if ( $type =~ /^(fsp|bpa|cec|frame|blade)$/ ) { + if ($type eq 'blade') { + if ($state =~ /power-on-transition|power off/) { + $state = "off"; + } else { + $state = "on"; + } + } $lparid = $type; } $outhash{ $lparid } = $state; @@ -370,7 +377,7 @@ sub state { # Look up by lparid ################################## my $type = @$d[4]; - my $id = ($type=~/^(fsp|bpa|cec|frame)$/) ? $type : @$d[0]; + my $id = ($type=~/^(fsp|bpa|cec|frame|blade)$/) ? $type : @$d[0]; ################################## # Output error @@ -387,7 +394,7 @@ sub state { ################################## # Node not found ################################## - if ( !exists( $data->{$id} )) { + if ($type !~ /^blade$/ and !exists( $data->{$id} )) { my $res = xCAT::FSPUtils::fsp_api_action($name, $d, "state"); my $rc = @$res[2]; my $val = @$res[1]; @@ -411,13 +418,6 @@ sub state { ############################## # Convert state to on/off ############################## - if ($type eq 'blade') { - if ($value =~ /^(power-on-transition|power off|off)$/) { - $value = "off"; - } else { - $value = "on"; - } - } if ( defined( $convert )) { $value = power_status( $value ); }