From 8fb91c4ba8834148cbce3d761f66736250bc74bb Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 7 Jul 2009 11:38:53 +0000 Subject: [PATCH] fix from mixing compute and service nodes on rsync , thanks to Storable qw(dclone) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3715 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xdsh.pm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 10e5b9234..2da2f3194 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -13,6 +13,7 @@ #------------------------------------------------------- package xCAT_plugin::xdsh; use strict; +use Storable qw(dclone); require xCAT::Table; require xCAT::Utils; @@ -55,7 +56,7 @@ sub preprocess_request my $cb = shift; my %sn; my $sn; - + #if already preprocessed, go straight to request if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } my $nodes = $req->{node}; @@ -140,19 +141,20 @@ sub preprocess_request # the original command, and add for each SN, if hierarchical foreach my $snkey (keys %$sn) { - my $reqcopy = {%$req}; if (!grep(/$snkey/, @MNnodeipaddr)) - { # not the MN + { # entries run from the Service Node # if the -F option to sync the nodes # then for a Service Node # change the command to use the -F /tmp/xcatrf.tmp # because that is where the file was put on the SN # + my $newSNreq = dclone($req); if ($syncsnfile) # -F option { - my $args = $reqcopy->{arg}; + my $args = $newSNreq->{arg}; + my $i = 0; foreach my $argument (@$args) { @@ -162,19 +164,19 @@ sub preprocess_request if ($argument eq "-F") { $i++; - $reqcopy->{arg}->[$i] = $tmpsyncsnfile; + $newSNreq->{arg}->[$i] = $tmpsyncsnfile; last; } $i++; } } - $reqcopy->{node} = $sn->{$snkey}; - $reqcopy->{'_xcatdest'} = $snkey; - $reqcopy->{_xcatpreprocessed}->[0] = 1; - push @requests, $reqcopy; + $newSNreq->{node} = $sn->{$snkey}; + $newSNreq->{'_xcatdest'} = $snkey; + $newSNreq->{_xcatpreprocessed}->[0] = 1; + push @requests, $newSNreq; } else - { # non hierarchy , build for Management node + { # entries run from Management node my $reqcopy = {%$req}; $reqcopy->{node} = $sn->{$snkey}; $reqcopy->{'_xcatdest'} = $snkey;