From c2b5c89f29abe1fcd31c86ca89bae5bb83548a3e Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Tue, 23 Aug 2011 03:09:26 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/FSPcfg.pm | 24 ++++++++++++++---------- xCAT-server/lib/perl/xCAT/PPC.pm | 31 +++++++++++++++++-------------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/perl-xCAT/xCAT/FSPcfg.pm b/perl-xCAT/xCAT/FSPcfg.pm index 067b10fd8..edb366544 100644 --- a/perl-xCAT/xCAT/FSPcfg.pm +++ b/perl-xCAT/xCAT/FSPcfg.pm @@ -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" )); } diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index acef972ca..51ee7f8b9 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -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) - } ##########################################################################