diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index a6ab799bb..46d8cafcf 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -1100,7 +1100,8 @@ sub preprocess_request { my $package = shift; my $req = shift; - if ($req->{_xcatdest}) { return [$req]; } #exit if preprocessed + #if ($req->{_xcatdest}) { return [$req]; } #exit if preprocessed + if ($req->{_xcatpreprocessed}->[0] == 1 ) { return [$req]; } my $callback = shift; my @requests; @@ -1123,7 +1124,7 @@ sub preprocess_request { $package =~ s/xCAT_plugin:://; #################################### - # Prompt for usage if needed + # Prompt for usage if needed and on MN #################################### my $noderange = $req->{node}; #Should be arrayref my $command = $req->{command}->[0]; @@ -1132,20 +1133,22 @@ sub preprocess_request { if (ref($extrargs)) { @exargs=@$extrargs; } - - my $usage_string=xCAT::Usage->parseCommand($command, @exargs); - if ($usage_string) { - $callback->({data=>[$usage_string]}); - $req = {}; - return; - } - if (!$noderange) { - $usage_string=xCAT::Usage->getUsage($command); - $callback->({data=>[$usage_string]}); - $req = {}; - return; + if ($ENV{'XCATBYPASS'}){ + my $usage_string=xCAT::Usage->parseCommand($command, @exargs); + if ($usage_string) { + $callback->({data=>[$usage_string]}); + $req = {}; + return ; + } + if (!$noderange) { + $usage_string="Missing noderange"; + $callback->({data=>[$usage_string]}); + $req = {}; + return ; + } } + ################################################################## # get the HCPs for the LPARs in order to figure out which service # nodes to send the requests to @@ -1209,6 +1212,7 @@ sub preprocess_request { #$callback->({data=>["The service node $snkey "]}); my $reqcopy = {%$req}; $reqcopy->{'_xcatdest'} = $snkey; + $reqcopy->{_xcatpreprocessed}->[0] = 1; my $hcps1=$sn->{$snkey}; my @nodes=(); foreach (@$hcps1) { diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 7e0f3db6f..92b6d1970 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1927,7 +1927,9 @@ sub getbladecons { sub preprocess_request { my $request = shift; - if ($request->{_xcatdest}) { return [$request]; } #exit if preprocessed + #if ($request->{_xcatdest}) { return [$request]; } #exit if preprocessed + + if ($request->{_xcatpreprocessed}->[0] == 1 ) { return [$request]; } my $callback=shift; my @requests; @@ -1948,7 +1950,8 @@ sub preprocess_request { } if (!$noderange) { - $usage_string=xCAT::Usage->getUsage($command); + $usage_string="Missing Noderange\n"; + $usage_string .=xCAT::Usage->getUsage($command); $callback->({data=>$usage_string}); $request = {}; return; @@ -1995,6 +1998,7 @@ sub preprocess_request { #print "snkey=$snkey\n"; my $reqcopy = {%$request}; $reqcopy->{'_xcatdest'} = $snkey; + $reqcopy->{_xcatpreprocessed}->[0] = 1; my $mms1=$sn->{$snkey}; my @moreinfo=(); my @nodes=();