fix for bug #3474362
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11417 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -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']); | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user