sync_timesetting(rootdir)
sync_passwdfile(rootdir)
retcode = subprocess.call(cmd, preexec_fn=mychroot, env=env, shell=shell)
- except (OSError, IOError), err:
- raise RuntimeError(err)
+ except (OSError, IOError):
+ # add additional information to original exception
+ value, tb = sys.exc_info()[1:]
+ value = '%s: %s' % (value, ' '.join(cmd))
+ raise RuntimeError, value, tb
finally:
if self.logfile and os.path.isfile(self.logfile):
msger.log(file(self.logfile).read())
msger.warning('\n%s' % err)
if msger.ask("Switch to native mode and continue?"):
return
- else:
- raise errors.BootstrapError("Failed to create bootstrap: %s" % err)
+ raise
except RuntimeError, err:
- raise errors.BootstrapError("Failed to run in bootstrap: %s" % err)
+ #change exception type but keep the trace back
+ value, tb = sys.exc_info()[1:]
+ raise errors.BootstrapError, value, tb
else:
sys.exit(ret)
finally: