os.chroot(rootdir)
os.chdir(chdir)
+ def sync_timesetting(rootdir):
+ try:
+ # sync time and zone info to bootstrap
+ if os.path.exists(rootdir + "/etc/localtime"):
+ os.unlink(rootdir + "/etc/localtime")
+ shutil.copyfile("/etc/localtime", rootdir + "/etc/localtime")
+ except:
+ pass
+
if not rootdir:
rootdir = self.rootdir
try:
proxy.set_proxy_environ()
gloablmounts = setup_chrootenv(rootdir, bindmounts, False)
+ sync_timesetting(rootdir)
retcode = subprocess.call(cmd, preexec_fn=mychroot, env=env, shell=shell)
except (OSError, IOError), err:
raise RuntimeError(err)
# append normal msg to LOG
save_msg = msg.strip() if msg else None
if save_msg:
- timestr = time.strftime("[%m/%d %H:%M:%S] ", time.localtime())
+ timestr = time.strftime("[%m/%d %H:%M:%S %Z] ", time.localtime())
LOG_CONTENT += timestr + save_msg + '\n'
if errormsg: