diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index 5262c96a1..202fb21d1 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -74,12 +74,18 @@ sub create_mypostscript_or_not { if ($entries[0] ) { $entries[0] =~ tr/a-z/A-Z/; if ($entries[0] =~ /^(1|YES)$/ ) { + #if the site.precreatemypostscripts=1, + # we will remove the mypostscript.$n.tmp files for the noderange + foreach my $n (@$nodes ) { + unlink("$tftpdir/mypostscripts/mypostscript.$n.tmp"); + } my $state; if ($request->{scripttype}) { $state = $request->{scripttype}->[0];} xCAT::Postage::makescript($nodes, $state, $callback,$notmpfiles,$nofiles); } } else { - #if the site.precreatemypostscripts=0, we will remove the mypostscript.$n + #if the site.precreatemypostscripts=0,we will remove the mypostscript.$n + # files for this noderange foreach my $n (@$nodes ) { unlink("$tftpdir/mypostscripts/mypostscript.$n"); }