From d589de64024b6b4cf5a0e13d2e2ee86dba9747a5 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 17 May 2012 17:04:36 +0000 Subject: [PATCH] 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 --- 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 3ed4b78f7..0eff52ad0 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -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."); - } + } + } } } }