fix bug 3392336, rspconfig give bpa plugin bug err when enableASMI=yes

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10340 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2011-08-23 03:09:26 +00:00
parent e32bf5d3df
commit c2b5c89f29
2 changed files with 31 additions and 24 deletions

View File

@ -146,17 +146,21 @@ sub parse_args {
foreach my $arg ( @ARGV ) {
my ($command,$value) = split( /=/, $arg );
if ( !grep( /^$command$/, @$supported) and !$opt{resetnet}) {
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
if (defined($enableASMI[0])) {
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES"))
{
my $res = xCAT::PPCcfg::parse_args($request, @_);
if (ref($res) eq 'ARRAY') {
return(usage( "Invalid command for $request->{hwtype} : $arg" ));
} else {
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
if (defined($enableASMI[0])) {
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
$request->{enableASMI} = 1;
return xCAT::PPCcfg::parse_args($request, @_);
}
}
return(usage( "Invalid command for $request->{hwtype} : $arg" ));
}
return $res;
}
}
return (usage( "You should enable \"ASMI\" first for \'$command\'."));
}
}
if ( exists( $cmds{$command} )) {
return(usage( "Command multiple times: $command" ));
}

View File

@ -1398,6 +1398,7 @@ sub process_children {
if (defined($conn_flag{$dir})) {
next;
}
$request->{$index->{node}}{cred} = $request->{$host}{cred};
my $res = &handle_cmd($index->{node}, $host, $request);
$output{$side} = \$res;
if ($res->[0]->{errorcode} ne '128') {
@ -2118,22 +2119,24 @@ sub process_request {
if ($request_new->{command} =~ /^(rspconfig|rpower|reventlog)$/){
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
if (defined($enableASMI[0])) {
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
#through asmi ......
$request_new->{fsp_api} = 0;
if(@failed_nodes != 0) {
my @temp = @failed_nodes;
@failed_nodes = ();
$request_new->{node} = \@temp;
process_command( $request_new , \%hcps_will, \@failed_nodes, \%failed_msg);
} #end of if
} #end of if
} # end of if
} #end of if
if (($request_new->{command} !~ /^rspconfig$/) ||
(ref($request_new->{method} eq 'HASH'))) {
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
#through asmi ......
$request_new->{fsp_api} = 0;
if(@failed_nodes != 0) {
my @temp = @failed_nodes;
@failed_nodes = ();
$request_new->{node} = \@temp;
process_command( $request_new , \%hcps_will, \@failed_nodes, \%failed_msg);
} #end of if
} #end of if
} # end of if
} #end of if
}
} #end of if
} #end of while(1)
}
##########################################################################