From 80ce5532e7b9ac53bbacae9fe26561901891d4b6 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 5 May 2014 11:52:41 -0400 Subject: [PATCH] defect 4112 --- perl-xCAT/xCAT/DSHCLI.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index e6a3ab178..9f5cc2ac9 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -1020,6 +1020,7 @@ sub fork_fanout_dsh } } # save the original exports, we are going to add the unique node name below + my $firstpass=0; while (@$targets_waiting && (keys(%$targets_active) < $$options{'fanout'})) { @@ -1046,6 +1047,7 @@ sub fork_fanout_dsh } if ($$options{'environment'}) { + if ($firstpass ==0) { # do the servicenode stuff only once # if we are on a servicenode need to get the environment file # from the SNsyncfiledir, not local if (xCAT::Utils->isServiceNode()) { @@ -1068,8 +1070,10 @@ sub fork_fanout_dsh $rsp->{error}->[0] = "File $$options{'environment'} does not exist"; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); } - # build the xdsh command - push @dsh_command, + $firstpass=1; + } + # build the xdsh command + push @dsh_command, "$exportnode$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}"; }