From e762911f5ea7fc43d519def5feb9efba682f2de5 Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 18 Jan 2010 06:14:05 +0000 Subject: [PATCH] FSPvitals with lcds support; FSPflash with --recover's defect is fixed. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4963 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPflash.pm | 3 ++- perl-xCAT/xCAT/FSPpower.pm | 32 +++++++++++++++++++++-------- perl-xCAT/xCAT/PPCrflash.pm | 5 ++++- xCAT-server/lib/perl/xCAT/PPC.pm | 4 +++- xCAT-server/lib/xcat/plugins/bpa.pm | 4 ++-- xCAT-server/lib/xcat/plugins/fsp.pm | 3 ++- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/perl-xCAT/xCAT/FSPflash.pm b/perl-xCAT/xCAT/FSPflash.pm index 06469d5f6..10d4a602d 100644 --- a/perl-xCAT/xCAT/FSPflash.pm +++ b/perl-xCAT/xCAT/FSPflash.pm @@ -355,7 +355,8 @@ sub action { my $action = shift; # my $user = "HMC"; # my $password = "abc123"; - my $fsp_api ="/home/fsp-api"; +# my $fsp_api ="/opt/xcat/sbin/fsp-api"; + my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api"; my $id = 1; my $fsp_name = (); my $fsp_ip = (); diff --git a/perl-xCAT/xCAT/FSPpower.pm b/perl-xCAT/xCAT/FSPpower.pm index dd10c2407..fa1f7eae1 100644 --- a/perl-xCAT/xCAT/FSPpower.pm +++ b/perl-xCAT/xCAT/FSPpower.pm @@ -173,10 +173,13 @@ sub state { my $request = shift; my $hash = shift; -# my $prefix = shift; -# my $convert = shift; + my $exp = shift; # NOt use + my $prefix = shift; + my $convert = shift; my @output = (); - + + + #print "------in state--------\n"; #print Dumper($request); #print Dumper($hash); @@ -207,7 +210,7 @@ sub state { for my $node_name ( keys %$node_hash) { my $d = $node_hash->{$node_name}; - my $stat = action ($node_name, $d, "state"); + my $stat = action ($node_name, $d, "state", $prefix, $convert); my $Rc = shift(@$stat); my $data = @$stat[0]; my $t = $data->{$node_name}; @@ -237,6 +240,8 @@ sub action { my $node_name = shift; my $attrs = shift; my $action = shift; + my $prefix = shift; + my $convert = shift; # my $fsp_api ="/opt/xcat/sbin/fsp-api"; my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api"; my $id = 1; @@ -318,12 +323,23 @@ sub action { return ([$Rc, \%outhash]); } } - - ################## + ############################## + # Convert state to on/off + ############################## + if ( defined( $convert )) { + $res = power_status( $res ); + } + + #print Dumper($prefix); + ################## # state cec_state ################# - $outhash{ $node_name } = $res; - + if (!defined($prefix)) { + $outhash{ $node_name } = $res; + } else { + $outhash{ $node_name } = "$prefix $res"; + } + return( [$Rc,\%outhash] ); } diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index 3284bfffe..57dede651 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -11,7 +11,6 @@ use xCAT::Table; use Getopt::Long; use File::Spec; use POSIX qw(tmpnam); -use xCAT::FSPflash; my $packages_dir= (); @@ -149,6 +148,8 @@ sub parse_args { print "no housekeeping - update mode\n"; $housekeeping = undef; } + + $request->{housekeeping} = $housekeeping; ############################################# # Option -V for verbose output @@ -548,6 +549,8 @@ sub rflash { my $hwtype = @$exp[2]; my @result; my $timeout = $request->{ppctimeout}; + + my $housekeeping = $request->{housekeeping}; $packages_dir = $request->{opt}->{p}; $activate = $request->{opt}->{activate}; diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 2b7013b57..8cd474f48 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -32,6 +32,8 @@ my %modules = ( bpa => "xCAT::FSPpower", }, rvitals => { hmc => "xCAT::PPCvitals", + fsp => "xCAT::FSPvitals", + bpa => "xCAT::FSPvitals", }, rscan => { hmc => "xCAT::PPCscan", }, @@ -165,7 +167,7 @@ sub process_command { my $fsp_api = check_fsp_api($request); if($fsp_api == 0 && ($request->{command} =~ /^(rpower)$/ || $request->{command} =~ /^rinv$/ || $request->{command} =~ /^rflash$/ - || $request->{command} =~ /^getmacs$/ || $request->{command} =~ /^rnetboot$/ ) + || $request->{command} =~ /^getmacs$/ || $request->{command} =~ /^rnetboot$/ || $request->{command} =~ /^rvitals$/ ) ) { #support FSPpower, FSPinv and FSPrflash $request->{fsp_api} = 1; diff --git a/xCAT-server/lib/xcat/plugins/bpa.pm b/xCAT-server/lib/xcat/plugins/bpa.pm index e4e4ab519..15765f3f8 100644 --- a/xCAT-server/lib/xcat/plugins/bpa.pm +++ b/xCAT-server/lib/xcat/plugins/bpa.pm @@ -15,8 +15,8 @@ sub handled_commands { rmhwconn => 'nodehm:mgt', lshwconn => 'nodehm:mgt', rinv => 'nodehm:mgt', - rflash => 'nodehm:mgt' - + rflash => 'nodehm:mgt', + rvitals => 'nodehm:mgt' }; } diff --git a/xCAT-server/lib/xcat/plugins/fsp.pm b/xCAT-server/lib/xcat/plugins/fsp.pm index ec114e92f..8eeebd46b 100644 --- a/xCAT-server/lib/xcat/plugins/fsp.pm +++ b/xCAT-server/lib/xcat/plugins/fsp.pm @@ -20,7 +20,8 @@ sub handled_commands { rinv => 'nodehm:mgt', rflash => 'nodehm:mgt', getmacs => 'nodehm:mgt', - rnetboot => 'nodehm:mgt' + rnetboot => 'nodehm:mgt', + rvitals => 'nodehm:mgt' }; }