From 62d58ee68ec089aeb14990debe4bdfc55bc0e269 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 13 May 2013 12:14:03 +0000 Subject: [PATCH] xdsh will send the node name in the NODE environment variable on execution, used for new precreatepostscript support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16269 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 4c0d2e609..497439b97 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -1019,11 +1019,15 @@ sub fork_fanout_dsh } } } - + # save the original exports, we are going to add the unique node name below + my $origprecommand=$$options{'pre-command'}; while (@$targets_waiting && (keys(%$targets_active) < $$options{'fanout'})) { my $user_target = shift @$targets_waiting; + # now add export NODE=nodename to the pre-command; + my $exportnode="export NODE=$user_target;"; + $$options{'pre-command'} = $exportnode . $origprecommand; my $target_properties = $$resolved_targets{$user_target}; my @commands; my $localShell = @@ -1037,7 +1041,6 @@ sub fork_fanout_dsh $$options{'post-command'} = ""; $dsh_cmd_background = 1; } - if ($$options{'environment'}) { # if we are on a servicenode need to get the environment file