From 833b460f10511d32a93b1e27c615b8f27f54fe7b Mon Sep 17 00:00:00 2001 From: nott Date: Thu, 26 Jan 2012 16:30:19 +0000 Subject: [PATCH] fix for bug #3474362 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@11418 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/InstUtils.pm | 27 ---------- xCAT-server/lib/xcat/plugins/snmove.pm | 73 ++++++++++++++------------ 2 files changed, 38 insertions(+), 62 deletions(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index 4f7e053bd..f8efca6de 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -909,33 +909,6 @@ sub dolitesetup return 1; } - # - # Check the statelite table for duplicate node entries - # - my $recs=$statelitetab->getAllEntries(); - my @SLnodes; - foreach my $entry (@$recs) { - - # get the "node" value - my $node = $entry->{node}; - - # run it through noderange - my @newnodes = xCAT::NodeRange::noderange($node); - - # for each node - see if it's already in the list - foreach my $n (@newnodes) { - if (!grep (/^$n$/, @SLnodes) ) { - push(@SLnodes, $n); - } else { - # if it's already in the list then this is an error - my $rsp; - push @{$rsp->{data}}, "The node \'$n\' is included in multiple statelite entries.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; - } - } - } - # create the statelite table file my $foundentry=0; my $stateHash = $statelitetab->getNodesAttribs(\@nodelist, ['statemnt', 'mntopts']); diff --git a/xCAT-server/lib/xcat/plugins/snmove.pm b/xCAT-server/lib/xcat/plugins/snmove.pm index b397b2c51..abfd8931d 100644 --- a/xCAT-server/lib/xcat/plugins/snmove.pm +++ b/xCAT-server/lib/xcat/plugins/snmove.pm @@ -629,7 +629,7 @@ sub process_request $item++; my $stmnt = "$sn_hash{$n}{'xcatmaster'}:$dir"; $SLmodhash{$item}{'statemnt'} = $stmnt; - $SLmodhash{$item}{'node'} = $line->{node}; + $SLmodhash{$item}{'node'} = $n; } # check for the directory @@ -680,48 +680,51 @@ sub process_request next; } - if ($::VERBOSE) - { - my $rsp; - push @{$rsp->{data}}, - "Synchronizing $old_node_hash->{$n}->{'oldmaster'}:$dir to $sn_hash{$n}{'xcatmaster'}\n"; - xCAT::MsgUtils->message("I", $rsp, $callback); - } + if ( -d $dodir ) { - my $todir = dirname($dodir); + if ($::VERBOSE) + { + my $rsp; + push @{$rsp->{data}}, + "Synchronizing $old_node_hash->{$n}->{'oldmaster'}:$dir to $sn_hash{$n}{'xcatmaster'}\n"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } - # do rsync of file/dir - my $synccmd = - qq~/usr/bin/rsync -arlHpEAogDz $dodir $newsn{$n}:$todir 2>/dev/null~; + my $todir = dirname($dodir); - if ($::VERBOSE) { - my $rsp; - push @{$rsp->{data}}, "On $old_node_hash->{$n}->{'oldsn'}: Running: \'$synccmd\'\n"; + # do rsync of file/dir + my $synccmd = + qq~/usr/bin/rsync -arlHpEAogDz $dodir $newsn{$n}:$todir 2>/dev/null~; - xCAT::MsgUtils->message("I", $rsp, $callback); - } + if ($::VERBOSE) { + my $rsp; + push @{$rsp->{data}}, "On $old_node_hash->{$n}->{'oldsn'}: Running: \'$synccmd\'\n"; - my $output = - xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", + xCAT::MsgUtils->message("I", $rsp, $callback); + } + + my $output = + xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", $old_node_hash->{$n}->{'oldsn'}, $synccmd, 0); - if ($::RUNCMD_RC != 0) - { - my $rsp; - push @{$rsp->{data}}, - "Could not sync statelite \'$dodir\'."; - push @{$rsp->{data}}, "$output\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - $error++; - } - else - { - $id++; - $donehash{$id}{oldXM} = - $old_node_hash->{$n}->{'oldmaster'}; - $donehash{$id}{dir} = $dodir; - $donehash{$id}{newXM} = $sn_hash{$n}{'xcatmaster'}; + if ($::RUNCMD_RC != 0) + { + my $rsp; + push @{$rsp->{data}}, + "Could not sync statelite \'$dodir\'."; + push @{$rsp->{data}}, "$output\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $error++; + } + else + { + $id++; + $donehash{$id}{oldXM} = + $old_node_hash->{$n}->{'oldmaster'}; + $donehash{$id}{dir} = $dodir; + $donehash{$id}{newXM} = $sn_hash{$n}{'xcatmaster'}; + } } } # end if servers match