From 1413d8576233ec519cb7c1946c0a9460c30b0436 Mon Sep 17 00:00:00 2001 From: nott Date: Thu, 26 Jan 2012 16:16:40 +0000 Subject: [PATCH] fix for bug #3474362 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11417 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/InstUtils.pm | 27 --------- xCAT-server/lib/xcat/plugins/snmove.pm | 76 ++++++++++++++------------ 2 files changed, 40 insertions(+), 63 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 eecce4ffe..b0f903198 100644 --- a/xCAT-server/lib/xcat/plugins/snmove.pm +++ b/xCAT-server/lib/xcat/plugins/snmove.pm @@ -626,7 +626,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 @@ -677,49 +677,53 @@ 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>&1~; + 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>&1~; - 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 dodir exists } # end if servers match } # end - foreach node