Add copy of hosts file to AIX service nodes.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2302 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -694,7 +694,7 @@ ll~; | ||||
| 		# create the cmd line args | ||||
| 		my $arg_string=" "; | ||||
| 		foreach my $attr (keys %cmdargs) { | ||||
| 			$arg_string .= "-a $attr=$cmdargs{$attr} "; | ||||
| 			$arg_string .= "-a $attr=\"$cmdargs{$attr}\" "; | ||||
| 		} | ||||
|  | ||||
| 		if ($script_string) { | ||||
| @@ -753,6 +753,21 @@ ll~; | ||||
|         $error++; | ||||
|     } | ||||
|  | ||||
| 	# | ||||
| 	# make sure we have the latest /etc/hosts from the management node | ||||
| 	# | ||||
| 	my $master = xCAT::Utils->get_site_Master(); | ||||
| 	if (!&is_me($master)) { | ||||
| 		my $cpcmd = "rcp -r $master:/etc/hosts /etc"; | ||||
| 		my $output = xCAT::Utils->runcmd("$cpcmd", -1); | ||||
|         if ($::RUNCMD_RC  != 0) { | ||||
| 			my $rsp; | ||||
|             push @{$rsp->{data}}, "Could not get /etc/hosts from the management node.\n"; | ||||
|             xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
| 			$error++; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if ($error) { | ||||
| 		my $rsp; | ||||
| 		push @{$rsp->{data}}, "$Sname: One or more errors occurred when attempting to initialize AIX NIM nodes.\n"; | ||||
| @@ -3659,6 +3674,7 @@ sub prenimnodeset | ||||
|         Arguments: | ||||
|         Returns: | ||||
|                 0 - OK | ||||
|  | ||||
|                 1 - error | ||||
|         Globals: | ||||
|         Example: | ||||
| @@ -4176,8 +4192,9 @@ ll~; | ||||
| 		} | ||||
|  | ||||
| 	#	if ($::VERBOSE) { | ||||
| 			my $time=`date`; | ||||
| 			my $rsp; | ||||
| 			push @{$rsp->{data}}, "Initializing NIM machine \'$nim_name\'. This could take a while.\n"; | ||||
| 			push @{$rsp->{data}}, "Initializing NIM machine \'$nim_name\'. This could take a while. $time\n"; | ||||
| 			#push @{$rsp->{data}}, "Running: \'$initcmd\'\n"; | ||||
| 			xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
| 	#	} | ||||
| @@ -4229,6 +4246,37 @@ ll~; | ||||
| 		$error++; | ||||
|     } | ||||
|  | ||||
| 	# | ||||
| 	# make sure we have the latest /etc/hosts from the management node | ||||
| 	# | ||||
| 	my $master = xCAT::Utils->get_site_Master(); | ||||
| 	if (!&is_me($master)) { | ||||
| 		my $cpcmd = "rcp -r $master:/etc/hosts /etc"; | ||||
| 		my $output = xCAT::Utils->runcmd("$cpcmd", -1); | ||||
|         if ($::RUNCMD_RC  != 0) { | ||||
| 			my $rsp; | ||||
|             push @{$rsp->{data}}, "Could not get /etc/hosts from the management node.\n"; | ||||
|             xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
| 			$error++; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	# | ||||
| 	# make sure we have the latest /etc/hosts from the management node | ||||
| 	# | ||||
| 	my $master = xCAT::Utils->get_site_Master(); | ||||
| 	if (!&is_me($master)) { | ||||
| 		my $cpcmd = "rcp -r $master:/etc/hosts /etc"; | ||||
| 		my $output = xCAT::Utils->runcmd("$cpcmd", -1); | ||||
|         if ($::RUNCMD_RC  != 0) { | ||||
| 			my $rsp; | ||||
|             push @{$rsp->{data}}, "Could not get /etc/hosts from the management node.\n"; | ||||
|             xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
| 			$error++; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	# | ||||
| 	# process any errors | ||||
| 	# | ||||
|   | ||||
		Reference in New Issue
	
	Block a user