From 19377d5835457e71132d55bc0d0e8c0efccb3a27 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Tue, 26 Nov 2013 02:16:44 -0500 Subject: [PATCH] raise error if failed to install bootstrap Fixes: #1467 Change-Id: I78d0a207d7902f0c2ae16b31dc33bc2c893da1f7 Signed-off-by: Gui Chen --- mic/bootstrap.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) -- 2.7.4