diff --git a/xCAT-server/lib/xcat/plugins/boottarget.pm b/xCAT-server/lib/xcat/plugins/boottarget.pm index 338b466ce..91bb719b2 100644 --- a/xCAT-server/lib/xcat/plugins/boottarget.pm +++ b/xCAT-server/lib/xcat/plugins/boottarget.pm @@ -35,6 +35,9 @@ sub preprocess_request { my $req = shift; my $callback = shift; + #if already preprocessed, go straight to request + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + if ($req->{command}->[0] eq 'copycd') { #don't farm out copycd return [$req]; @@ -84,6 +87,7 @@ sub preprocess_request { #iterate dispatch targets my $reqcopy = {%$req}; #deep copy $reqcopy->{'_xcatdest'} = $dtarg; + $reqcopy->{_xcatpreprocessed}->[0] = 1; $reqcopy->{node} = [keys %{$dispatchhash{$dtarg}}]; push @requests, $reqcopy; } diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 091b0a682..901c0d392 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -35,7 +35,8 @@ sub handled_commands { 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; my $noderange = $request->{node}; #Should be arrayref @@ -114,6 +115,7 @@ sub preprocess_request { if (!$isSN) { # my $reqcopy = {%$request}; $reqcopy->{'_xcatdest'} = $master; + $reqcopy->{_xcatpreprocessed}->[0] = 1; $reqcopy->{'_allnodes'} = $allnodes; # the original command comes with nodes or not if ($allnodes==1) { @nodes=(); } $reqcopy->{node} = \@nodes; @@ -134,6 +136,7 @@ sub preprocess_request { if ($doit) { my $reqcopy = {%$request}; $reqcopy->{'_xcatdest'} = $cons; + $reqcopy->{_xcatpreprocessed}->[0] = 1; $reqcopy->{'_allnodes'} = [$allnodes]; # the original command comes with nodes or not $reqcopy->{node} = $cons_hash{$cons}{nodes}; my $no=$reqcopy->{node}; diff --git a/xCAT-server/lib/xcat/plugins/monctrlcmds.pm b/xCAT-server/lib/xcat/plugins/monctrlcmds.pm index 161ac362e..ad169ea28 100644 --- a/xCAT-server/lib/xcat/plugins/monctrlcmds.pm +++ b/xCAT-server/lib/xcat/plugins/monctrlcmds.pm @@ -63,6 +63,8 @@ sub preprocess_request my $callback = shift; my $command = $req->{command}->[0]; # if ($req->{_xcatdest}) { return [$req]; } #exit if preprocessed + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + if ($req->{module}) { return [$req]; } my $args=$req->{arg}; @@ -142,6 +144,7 @@ sub preprocess_request if (! $iphash{$sv}) { if ($isSV) { next; } #if the command is issued on the monserver, only handle its children. $reqcopy->{'_xcatdest'}=$sv; + $reqcopy->{_xcatpreprocessed}->[0] = 1; my $rsp2={}; $rsp2->{data}->[0]="sending request to $sv..., ".join(',', @$mon_nodes); $callback->($rsp2); diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 3df65a075..53f565d07 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -58,7 +58,10 @@ sub preprocess_request my $callback = shift; my $subreq = shift; my $command = $request->{command}->[0]; - if ($request->{_xcatdest}) { return [$request]; } #exit if preprocessed + #if ($request->{_xcatdest}) { return [$request]; } #exit if preprocessed + #if already preprocessed, go straight to request + if ($request->{_xcatpreprocessed}->[0] == 1) { return [$request]; } + my @requests=(); if ($command eq "updatenode") @@ -237,6 +240,8 @@ sub preprocess_updatenode { my $reqcopy = {%$request}; $reqcopy->{node} = $sn->{$snkey}; $reqcopy->{'_xcatdest'} = $snkey; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + if (defined ($::SWMAINTENANCE)) { $reqcopy->{swmaintenance} = "yes"; }