diff options
Diffstat (limited to 'timezone.py')
-rw-r--r-- | timezone.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/timezone.py b/timezone.py index 3960d819d..bb599bb57 100644 --- a/timezone.py +++ b/timezone.py @@ -19,6 +19,7 @@ import shutil import iutil +import os from flags import flags import logging @@ -43,10 +44,13 @@ class Timezone: fromFile = instPath + "/usr/share/zoneinfo/" + self.tz - try: - shutil.copyfile(fromFile, instPath + "/etc/localtime") - except OSError, (errno, msg): - log.error("Error copying timezone (from %s): %s" % (fromFile, msg)) + if not os.access(fromFile, os.R_OK): + log.error("Timezone to be copied (%s) doesn't exist" % fromFile) + else: + try: + shutil.copyfile(fromFile, instPath + "/etc/localtime") + except OSError, (errno, msg): + log.error("Error copying timezone (from %s): %s" % (fromFile, msg)) f = open(instPath + "/etc/sysconfig/clock", "w") |