From a013a88e0e7c84ee059004d137c1710235206970 Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 17 Jan 2013 09:15:27 +0000 Subject: [PATCH] fixd bug 3291, when run getpostscript.awk version2, create mypostscripts.nodename.tmp git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14908 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index f549689cb..1009d180f 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -922,12 +922,27 @@ sub subvars_for_mypostscript { mkdir($scriptdir,0777); } + my $postfix; + my @entries = xCAT::TableUtils->get_site_attribute("precreatemypostscripts"); + if ($entries[0] ) { + $entries[0] =~ tr/a-z/A-Z/; + if ($entries[0] !~ /^(1|YES)$/ ) { + $postfix="tmp"; + } + } else { + $postfix="tmp"; + } + foreach my $n (@$nodes ) { $node = $n; $inc = $t_inc; my $script; my $scriptfile; - $scriptfile = "$tftpdir/mypostscripts/mypostscript.$node"; + if( defined( $postfix ) ) { + $scriptfile = "$tftpdir/mypostscripts/mypostscript.$node.tmp"; + } else { + $scriptfile = "$tftpdir/mypostscripts/mypostscript.$node"; + } #mkpath(dirname($scriptfile)); open($script, ">$scriptfile");