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
This commit is contained in:
jjhua
2011-12-07 07:51:57 +00:00
parent a7ab35be04
commit e2adff9290
2 changed files with 10 additions and 7 deletions
+3
View File
@@ -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";
}
+7 -7
View File
@@ -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];