fix for defect 3527641
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12766 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
3c0dd360f5
commit
d589de6402
@ -1796,6 +1796,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) {
|
||||
@ -1814,6 +1815,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;
|
||||
@ -1824,14 +1826,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)
|
||||
{
|
||||
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