fix defect 3529041
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12912 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
d35ff774bf
commit
8c73c1a3c8
@ -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";
|
||||
@ -381,10 +381,12 @@ if ($nodesetstat eq 'diskless') {
|
||||
# see if BASECUST_REMOVAL is set in /etc/niminfo
|
||||
if (-f "/etc/niminfo") {
|
||||
$cmd = "cat /etc/niminfo | grep 'BASECUST_REMOVAL'";
|
||||
$::NOERROR=1;
|
||||
&runcmd($cmd);
|
||||
my $line = $::outref;
|
||||
my ($junk, $torm) = split(/=/, $line);
|
||||
|
||||
$::NOERROR=0;
|
||||
$cmd = "cat /etc/niminfo | grep 'NIM_HOSTNAME'";
|
||||
&runcmd($cmd);
|
||||
$line = $::outref;
|
||||
@ -549,7 +551,7 @@ sub runcmd
|
||||
{
|
||||
my ($cmd, $logerr) = @_;
|
||||
|
||||
if(! defined($logerr)) {
|
||||
if(! defined($logerr)) { # always log errors
|
||||
$logerr = 1;
|
||||
}
|
||||
my $rc=0;
|
||||
@ -561,7 +563,9 @@ sub runcmd
|
||||
$rc = $? >> 8;
|
||||
if ($rc > 0 && $logerr)
|
||||
{
|
||||
print "$::sdate xcataixpost: run: $cmd - $::outref\n";
|
||||
if ($::NOERROR == 0) { # print the error message
|
||||
print "$::sdate xcataixpost: run: $cmd - $::outref\n";
|
||||
}
|
||||
print $::LOG_FILE "$::sdate xcataixpost: run: $cmd - $::outref\n";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user