From 26c77b4fbab93ddebf3432c5ae28a24a4f438cb8 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Tue, 19 Mar 2013 15:03:49 -0700 Subject: [PATCH] Print & log messages on scriptlet/transaction errors We should probably let the user know if something goes wrong with the transaction or if a scriptlet fails. So: log the messages so we can find (and, one hopes, fix) them later. --- src/pylorax/yumhelper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py index ea0ef07d..13a2bdad 100644 --- a/src/pylorax/yumhelper.py +++ b/src/pylorax/yumhelper.py @@ -115,3 +115,10 @@ class LoraxRpmCallback(yum.rpmtrans.RPMBaseCallback): def filelog(self, package, action): if self.fileaction.get(action) == "Installed": logger.debug("{0} installed successfully".format(package)) + + def errorlog(self, msg): + logger.warning("RPM transaction error: %s", msg) + + def scriptout(self, package, msgs): + if msgs: + logger.info("%s scriptlet output:\n%s", package, msgs)