From 4f6485c8417a9e98820b10b0a622fb329d8ab0ab Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 7 Feb 2013 12:12:36 +0000 Subject: [PATCH] hierarchical -E support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15084 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 0ab10d35f..091f7e050 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -1034,6 +1034,28 @@ sub fork_fanout_dsh if ($$options{'environment'}) { + # if we are on a servicenode need to get the environment file + # from the SNsyncfiledir, not local + if (xCAT::Utils->isServiceNode()) { + my $newenvfile; + my $synfiledir = "/var/xcat/syncfiles"; #default + + # get the directory on the servicenode to and add to filepath + my @syndir= xCAT::TableUtils->get_site_attribute("SNsyncfiledir"); + if ($syndir[0]) + { + $synfiledir = $syndir[0]; + } + $newenvfile = $synfiledir; + $newenvfile .= $$options{'environment'}; + $$options{'environment'} = $newenvfile; + } + if (!(-e $$options{'environment'})) + { + my $rsp={}; + $rsp->{error}->[0] = "File $$options{'environment'} does not exist"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); + } push @dsh_command, "$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}"; } @@ -1163,13 +1185,13 @@ sub fork_fanout_dsh if ($$options{'execute'}) { # first build the scp command to copy the file to execute - # down to the node into /tmp/*.dsh + # down to the node into /tmp/*.dsh my $rsp = {}; $rsp->{data}->[0] = "TRACE: Execute option specified."; $dsh_trace && (xCAT::MsgUtils->message("I", $rsp, $::CALLBACK)); my %exe_rcp_config = (); - $tmp_cmd_file = POSIX::tmpnam . ".dsh"; + $tmp_cmd_file = POSIX::tmpnam . ".dsh"; my ($exe_cmd, @args) = @{$$options{'execute'}}; my $chmod_cmd = "";