diff --git a/xCAT/postscripts/xcataixpost b/xCAT/postscripts/xcataixpost index 345c8664a..a4f6e5f18 100755 --- a/xCAT/postscripts/xcataixpost +++ b/xCAT/postscripts/xcataixpost @@ -36,7 +36,7 @@ my $logdir = "/var/log/xcat"; if (!-d $logdir) { mkpath($logdir); } - +$::NOERROR=0; # used to control whether to display an error $::sdate = `/bin/date`; chomp $::sdate; my $logfile = $logdir . "/xcat.log"; @@ -380,11 +380,13 @@ if ($nodesetstat eq 'standalone') { if ($nodesetstat eq 'diskless') { # see if BASECUST_REMOVAL is set in /etc/niminfo if (-f "/etc/niminfo") { + $::NOERROR=1; $cmd = "cat /etc/niminfo | grep 'BASECUST_REMOVAL'"; &runcmd($cmd); my $line = $::outref; my ($junk, $torm) = split(/=/, $line); + $::NOERROR=0; $cmd = "cat /etc/niminfo | grep 'NIM_HOSTNAME'"; &runcmd($cmd); $line = $::outref; @@ -561,8 +563,10 @@ sub runcmd $rc = $? >> 8; if ($rc > 0 && $logerr) { + if ($::NOERROR == 0) { # print the error message print "$::sdate xcataixpost: run: $cmd - $::outref\n"; - print $::LOG_FILE "$::sdate xcataixpost: run: $cmd - $::outref\n"; + } + print $::LOG_FILE "$::sdate xcataixpost: run: $cmd - $::outref\n"; } } return $rc;