pre-create mypostscript enhancement: remove the old mypostscript. if site.precreatemypostscripts=0

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14219 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-11-02 07:03:44 +00:00
parent 300de0daf0
commit 05f66ec8fc

View File

@ -101,7 +101,6 @@ sub create_mypostscript_or_not {
my $nodes = $request->{node};
my $tftpdir = xCAT::TableUtils::getTftpDir();
system("rm -rf $tftpdir/mypostscripts");
#if precreatemypostscripts=1, create each mypostscript for each node
my @entries = xCAT::TableUtils->get_site_attribute("precreatemypostscripts");
if ($entries[0] ) {
@ -112,7 +111,13 @@ sub create_mypostscript_or_not {
if ($request->{scripttype}) { $state = $request->{scripttype}->[0];}
xCAT::Postage::makescript($nodes, $state, $callback);
}
}
} else {
#if the site.precreatemypostscripts=0, we will remove the mypostscript.$n
foreach my $n (@$nodes ) {
unlink("$tftpdir/mypostscripts/mypostscript.$n");
}
}
}