summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/Yum.py23
-rw-r--r--src/lib/Client/Tools/__init__.py2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/Yum.py b/src/lib/Client/Tools/Yum.py
new file mode 100644
index 000000000..62ccbffc4
--- /dev/null
+++ b/src/lib/Client/Tools/Yum.py
@@ -0,0 +1,23 @@
+# This is the bcfg2 support for yum
+'''This provides bcfg2 support for yum'''
+__revision__ = '$Revision:$'
+
+import Bcfg2.Client.Tools.RPM
+
+class Yum(Bcfg2.Client.Tools.RPM.RPM):
+ '''Support for Yum packages'''
+ pkgtype = 'yum'
+ pkgtool = ("/usr/bin/yum install %s", ("%s-%s", ["name", "version"]))
+ __name__ = 'Yum'
+ __execs__ = ['/usr/bin/yum']
+ __handles__ = [('Package', 'yum')]
+
+ def RemovePackages(self, packages):
+ '''Remove specified entries'''
+ pkgnames = [pkg.get('name') for pkg in packages]
+ if len(pkgnames) > 0:
+ self.logger.info("Removing packages: %s" % pkgnames)
+ if self.cmd.run("yum remove %s" % " ".join(pkgnames))[0] == 0:
+ self.modified += packages
+ self.RefreshPackages()
+ self.extra = self.FindExtraPackages()
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 42ead2ed9..762728eae 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -1,7 +1,7 @@
'''This contains all Bcfg2 Tool modules'''
__revision__ = '$Revision$'
-__all__ = ["APT", "Blast", "Chkconfig", "DebInit", "Encap", "Portage",
+__all__ = ["APT", "Blast", "Chkconfig", "DebInit", "Encap", "Portage", "Yum"
"PostInstall", "POSIX", "RPM", "RcUpdate", "SMF", "SYSV", "launchd"]
import os, popen2, stat, sys, Bcfg2.Client.XML