From: Gui Chen Date: Tue, 26 Nov 2013 07:16:44 +0000 (-0500) Subject: raise error if failed to install bootstrap X-Git-Tag: 0.23~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19377d5835457e71132d55bc0d0e8c0efccb3a27;p=tools%2Fmic.git raise error if failed to install bootstrap Fixes: #1467 Change-Id: I78d0a207d7902f0c2ae16b31dc33bc2c893da1f7 Signed-off-by: Gui Chen --- diff --git a/mic/bootstrap.py b/mic/bootstrap.py index 29e8655..d59b718 100644 --- a/mic/bootstrap.py +++ b/mic/bootstrap.py @@ -135,7 +135,17 @@ class MiniBackend(object): # run transaction self.ts.order() cb = RPMInstallCallback(self.ts) - self.ts.run(cb.callback, '') + errors = self.ts.run(cb.callback, '') + + # ts.run() exit codes are, hmm, "creative": None means all ok, empty + # list means some errors happened in the transaction and non-empty + # list that there were errors preventing the ts from starting... + if errors is None: + pass + elif len(errors) == 0: + msger.warning("Warning: scriptlet or other non-fatal errors occurred") + else: + raise errors.BootstrapError("Transaction couldn't start: %s" % '\n'.join(errors)) def run_pkg_script(self, pkg, prog, script, arg): mychroot = lambda: os.chroot(self.rootdir)