From e2adff929094937d775d0d9e059d5871ab5df1e2 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 7 Dec 2011 07:51:57 +0000 Subject: [PATCH] pass the powerinterval into fsp-api with on/reset actions git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@11148 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPUtils.pm | 3 +++ perl-xCAT/xCAT/FSPpower.pm | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/FSPUtils.pm b/perl-xCAT/xCAT/FSPUtils.pm index d9d81dca7..289af4435 100644 --- a/perl-xCAT/xCAT/FSPUtils.pm +++ b/perl-xCAT/xCAT/FSPUtils.pm @@ -156,6 +156,9 @@ sub fsp_api_action { if( defined($parameter) ) { if ($action =~ /^set_(frame|cec|lpar)_name$/) { $cmd = "$fsp_api -a $action -n $parameter -T $tooltype -t $type:$fsp_ip:$id:$node_name:"; + } elsif( $parameter !=0 && $action =~ /^(on|reset)$/ ) { + #powerinterval for lpars power on + $cmd = "$fsp_api -a $action -i $parameter -T $tooltype -t $type:$fsp_ip:$id:$node_name:"; } else { $cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter"; } diff --git a/perl-xCAT/xCAT/FSPpower.pm b/perl-xCAT/xCAT/FSPpower.pm index 2c766272f..70ba605cd 100644 --- a/perl-xCAT/xCAT/FSPpower.pm +++ b/perl-xCAT/xCAT/FSPpower.pm @@ -175,7 +175,7 @@ sub powercmd { my $lpar_flag = 0; my $cec_flag = 0; my $frame_flag = 0; - + #print "++++in powercmd++++\n"; #print Dumper($hash); @@ -198,7 +198,7 @@ sub powercmd { foreach $node_name ( keys %$hash) { - $action = $request->{'op'}; + $action = $request->{'op'}; my $d = $hash->{$node_name}; if ($$d[4] =~ /^lpar$/) { if( !($action =~ /^(on|off|of|reset|sms)$/)) { @@ -241,19 +241,19 @@ sub powercmd { } if( $lpar_flag && $cec_flag) { - push @output, [$node_name," $node_name\'s type is different from the last name. The noderange of power control operation could NOT be lpar/cec mixed" , -1 ]; + push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be lpar/cec mixed" , -1 ]; return (\@output); } if( $lpar_flag && $frame_flag) { - push @output, [$node_name," $node_name\'s type is different from the last name. The noderange of power control operation could NOT be lpar/frame mixed" , -1 ]; + push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be lpar/frame mixed" , -1 ]; return (\@output); } if( $cec_flag && $frame_flag) { - push @output, [$node_name," $node_name\'s type is different from the last name. The noderange of power control operation could NOT be cec/frame mixed" , -1 ]; + push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be cec/frame mixed" , -1 ]; return (\@output); } @@ -263,8 +263,8 @@ sub powercmd { $$newd[0] = $newids; #print Dumper($newd); - - my $res = xCAT::FSPUtils::fsp_api_action($newnames, $newd, $action ); + + my $res = xCAT::FSPUtils::fsp_api_action($newnames, $newd, $action, 0, $request->{'powerinterval'} ); # print "In boot, state\n"; # print Dumper($res); my $Rc = @$res[2];