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:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user