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.
This commit is contained in:
Will Woods 2013-03-19 15:03:49 -07:00 committed by Brian C. Lane
parent 3a1e176cbb
commit 26c77b4fba
1 changed files with 7 additions and 0 deletions

View File

@ -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)