fix for defect 3527641
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12767 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
22eff119c4
commit
e8996a35dc
@ -1803,6 +1803,7 @@ sub cleanupPSTable
|
||||
if ($tab = xCAT::Table->new("postscripts")) {
|
||||
my @tableentries = $tab->getAllAttribs('node','postscripts');
|
||||
foreach my $entry (@tableentries) {
|
||||
my $changeit=0;
|
||||
my $node=$entry->{'node'};
|
||||
my $pslist=$entry->{'postscripts'};
|
||||
if ($pslist) {
|
||||
@ -1821,6 +1822,7 @@ sub cleanupPSTable
|
||||
$newpslist .=",";
|
||||
} else { # servicenode found, do not keep xcatserver/xcatclient
|
||||
if (($pscript =~ /(^|\|)xcatserver($|\|)/i) ||($pscript =~ /(^|\|)xcatclient($|\|)/i)) {
|
||||
$changeit=1; # had to remove xcatserver/xcatclient
|
||||
next;
|
||||
} else {
|
||||
$newpslist .=$pscript;
|
||||
@ -1830,14 +1832,16 @@ sub cleanupPSTable
|
||||
}
|
||||
}
|
||||
chop $newpslist;
|
||||
$newpslist .="\'";
|
||||
my $chtabcmds .=
|
||||
"$::XCATROOT/sbin/chtab node=$node postscripts.postscripts=$newpslist;";
|
||||
my $outref = xCAT::Utils->runcmd("$chtabcmds", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
$newpslist .="\'";
|
||||
if ($changeit == 1) { # we had to modify the line
|
||||
my $chtabcmds .=
|
||||
"$::XCATROOT/sbin/chtab node=$node postscripts.postscripts=$newpslist;";
|
||||
my $outref = xCAT::Utils->runcmd("$chtabcmds", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message('E',
|
||||
"Could not modify postscripts definition for $node.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user