From e0b6d38a8736c813479b21ef28a3af17da53a8cd Mon Sep 17 00:00:00 2001 From: sakolish Date: Wed, 5 Mar 2008 19:15:28 +0000 Subject: [PATCH] Return error code to be used for command exit code git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@692 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCvitals.pm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCvitals.pm b/perl-xCAT-2.0/xCAT/PPCvitals.pm index 89b51734f..a893a0db6 100644 --- a/perl-xCAT-2.0/xCAT/PPCvitals.pm +++ b/perl-xCAT-2.0/xCAT/PPCvitals.pm @@ -173,14 +173,14 @@ sub voltage { # No frame command on IVM ################################# if ( $hwtype eq "ivm" ) { - push @result, [$name,"$text Not available"]; + push @result, [$name,"$text Not available",1]; next; } ################################# # Voltages available in frame ################################# if ( @$d[4] ne "bpa" ) { - push @result, [$name,"$text Only available for BPA"]; + push @result, [$name,"$text Only available for BPA",1]; next; } my $volt = enumerate_volt( $exp, $d ); @@ -190,7 +190,7 @@ sub voltage { # Output error ################################# if ( $Rc != SUCCESS ) { - push @result, [$name,"$text @$volt[0]"]; + push @result, [$name,"$text @$volt[0]",$Rc]; next; } ################################# @@ -201,7 +201,7 @@ sub voltage { foreach ( @prefix ) { my $value = sprintf($_, $values[$i++]); - push @result, [$name,$value]; + push @result, [$name,$value,$Rc]; } } } @@ -233,7 +233,7 @@ sub temp { # No frame commands for IVM ################################# if ( $hwtype eq "ivm" ) { - push @result, [$name,"$prefix Not available (No BPA)"]; + push @result, [$name,"$prefix Not available (No BPA)",1]; next; } ################################# @@ -241,14 +241,14 @@ sub temp { ################################# if ( @$d[4] !~ /^fsp|lpar$/ ) { my $text = "$prefix Only available for CEC/LPAR"; - push @result, [$name,$text]; + push @result, [$name,$text,1]; next; } ################################# # Error - No frame ################################# if ( $mtms eq "0" ) { - push @result, [$name,"$prefix Not available (No BPA)"]; + push @result, [$name,"$prefix Not available (No BPA)",1]; next; } ################################# @@ -273,14 +273,14 @@ sub temp { # Output error ############################# if ( $Rc != SUCCESS ) { - push @result, [$name,"$prefix $data"]; + push @result, [$name,"$prefix $data",$Rc]; next; } ############################# # CEC not in frame ############################# if ( !exists( $data->{$mtms} )) { - push @result, [$name,"$prefix CEC '$mtms' not found"]; + push @result, [$name,"$prefix CEC '$mtms' not found",1]; next; } ############################# @@ -289,7 +289,7 @@ sub temp { my $cel = $data->{$mtms}; my $fah = ($cel * 1.8) + 32; my $value = "$prefix $cel C ($fah F)"; - push @result, [$name,$value]; + push @result, [$name,$value,$Rc]; } } return( \@result ); @@ -327,3 +327,4 @@ sub all { 1; +