Patch - yum check-update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello chaps,

I intended to submit this last month, but have been beastly ill.

This provides a method in the yum module to do a check-update, returning
the packages yum believes need to be updated.

S.
diff --git a/func/minion/modules/yumcmd.py b/func/minion/modules/yumcmd.py
index 6600d47..b3976fb 100644
--- a/func/minion/modules/yumcmd.py
+++ b/func/minion/modules/yumcmd.py
@@ -12,6 +12,7 @@
 from modules import func_module
 
 import yum
+from yum import repos
 
 # XXX Use internal yum callback or write a useful one.
 class DummyCallback(object):
@@ -23,7 +24,8 @@ class Yum(func_module.FuncModule):
 
     def __init__(self):
         self.methods = {
-                "update" : self.update
+                "update" : self.update,
+                "check_update" : self.check_update
         }
         func_module.FuncModule.__init__(self)
 
@@ -43,6 +45,14 @@ class Yum(func_module.FuncModule):
             ayum.doUnlock()
         return True
 
+    def check_update(self, repo=None):
+        """Returns a list of packages due to be updated"""
+        ayum = yum.YumBase()
+        ayum.doConfigSetup()
+        ayum.doTsSetup()
+        ayum.repos.enableRepo(repo)
+        return map(str, ayum.doPackageLists('updates').updates)
+
 
 methods = Yum()
 register_rpc = methods.register_rpc


[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux