[yum-git] yum-updatesd-helper

Jeremy Katz katzj at linux.duke.edu
Wed Jul 16 17:00:32 UTC 2008


 yum-updatesd-helper |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit cc7d40e3b91ad19cd03d6ffa708ee62048d2f09d
Author: John Horne <john.horne at plymouth.ac.uk>
Date:   Wed Jul 16 12:59:19 2008 -0400

    Give more output via syslog for various cases (#455346)
    
    yum-updatesd should log the number of updates available (which it does); the
    number of updates applied (if 'do_update = yes' is set); and any error messages
    if the updates fail.
    
    In our case we configure /etc/yum.conf on servers to exclude some packages.
    However, if these cause a dependency failure for other updates, then
    yum-updatesd should log this. The patch corrects this.
    
    The problem we found was that several servers had updates to apply, but it
    seemed that yum-updatesd was not applying them. Nothing was logged in
    /var/log/messages at all. It turned out that there was a dependency failure.
    Applying our patch, then yum-updatesd logged the failure.

diff --git a/yum-updatesd-helper b/yum-updatesd-helper
index 39cb5df..6123dce 100755
--- a/yum-updatesd-helper
+++ b/yum-updatesd-helper
@@ -97,6 +97,24 @@ class SyslogUpdateEmitter(UpdateEmitter):
 
         syslog.syslog(self._levelMap(level), msg)
 
+    def updatesApplied(self, updateInfo):
+        num = len(updateInfo)
+        level = self.level
+        if num > 1:
+            msg = "%d updates applied" %(num,)
+        elif num == 1:
+            msg = "1 update applied"
+        else:
+            msg = "No updates applied"
+            level = syslog.LOG_DEBUG
+
+        syslog.syslog(self._levelMap(level), msg)
+
+    def updatesFailed(self, errmsgs):
+        level = self.level
+        msg = "Updates failed: %s" % errmsgs
+        syslog.syslog(self._levelMap(level), msg)
+
     def _levelMap(self, lvl):
         level_map = { "EMERG": syslog.LOG_EMERG,
                       "ALERT": syslog.LOG_ALERT,



More information about the Yum-cvs-commits mailing list