Signed-off-by: Gui Chen <gui.chen@intel.com>
self.rootdir = rootdir
self.distro = distro
self.arch = arch
+ self.logfile = None
self.pkgslist = []
self.repomd = None
except (OSError, IOError), err:
raise RuntimeError(err)
finally:
+ if self.logfile:
+ msger.log(file(self.logfile).read())
cleanup_chrootenv(self.rootdir, bindmounts, gloablmounts)
proxy.unset_proxy_environ()
return retcode
else:
INTERACTIVE = False
+def log(msg=''):
+ # log msg to LOG_CONTENT then save to logfile
+ global LOG_CONTENT
+ if msg:
+ LOG_CONTENT += msg
+
def raw(msg=''):
_general_print('', NO_COLOR, msg)
# create bootstrap and run mic in bootstrap
bsenv = bootstrap.Bootstrap(rootdir, distro, cropts['arch'])
+ bsenv.logfile = cropts['logfile']
try:
msger.info("Creating %s bootstrap ..." % distro)
bsenv.create(cropts['repomd'], pkglist)