From 29aa9d83a7f7591dda99ed56af433b6d3608a212 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 22 May 2013 12:40:06 +0000 Subject: [PATCH] cleanup tmp files git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16389 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Postage.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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"); }