summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/Yum.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-01-10 21:59:55 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-01-10 21:59:55 +0000
commit95b3c04e41a6f0e7497d2f87152c66a45d71604e (patch)
tree798eb291fab7b4246213817bd991764f35119812 /src/lib/Client/Tools/Yum.py
parent3cab3bc24a2cff1295eae441c07d650eeb17f31f (diff)
downloadbcfg2-95b3c04e41a6f0e7497d2f87152c66a45d71604e.tar.gz
bcfg2-95b3c04e41a6f0e7497d2f87152c66a45d71604e.tar.bz2
bcfg2-95b3c04e41a6f0e7497d2f87152c66a45d71604e.zip
Add Yum driver
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2642 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/Yum.py')
-rw-r--r--src/lib/Client/Tools/Yum.py23
1 files changed, 23 insertions, 0 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()