From 99d4eb41cc229e2a204260e5525dcd6f931f9970 Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 7 Oct 2008 17:58:19 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 52 +++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index cb49bec72..bfe24e515 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -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 #