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
This commit is contained in:
jjhua 2013-01-17 09:15:27 +00:00
parent fb41dc3b81
commit a013a88e0e

View File

@ -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");