From e8996a35dcd75c581fbe3e825efc6af226d99318 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 17 May 2012 17:09:03 +0000 Subject: [PATCH] fix for defect 3527641 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12767 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatconfig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 113df33aa..6c33b8e51 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -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."); + } } } }