[PATCH lorax/master] Print & log messages on scriptlet/transaction errors

Will Woods wwoods at redhat.com
Tue Mar 19 04:51:10 UTC 2013


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 ea0ef07..13a2bda 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)
-- 
1.8.1.4



More information about the anaconda-patches mailing list