fix defect 3558801, do not set TZ if called by updatenode

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13559 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-08-20 16:32:28 +00:00
parent a16b7d5144
commit 9bd7ba8625

View File

@ -239,21 +239,26 @@ if (&runcmd($chcmd) != 0) {
}
if (-f $scriptname) {
# if called by updatenode do not change TZ
if (@ARGV > 0) {
if ($ARGV[0] == 1 || $ARGV[0] == 2) {
# set the timezone
my $cmd = "cat $scriptname | grep 'TIMEZONE='";
&runcmd($cmd);
my $TZline = $::outref;
my ($junk, $tz) = split(/=/, $TZline);
if ($tz) {
my $cmd = "cat $scriptname | grep 'TIMEZONE='";
&runcmd($cmd);
my $TZline = $::outref;
my ($junk, $tz) = split(/=/, $TZline);
if ($tz) {
chomp $tz;
my $tzcmd = qq~/usr/bin/chtz $tz >/dev/null 2>&1~;
if (&runcmd($tzcmd) != 0) {
my $msg = "$::sdate xcataixpost: Could not set timezone.\n";
`logger -t xcat -p local4.warning $msg`;
} else {
&runcmd("export TZ=$tz");
}
&runcmd("export TZ=$tz");
}
}
}
}
}
# check & run the postscript