From 95b3c04e41a6f0e7497d2f87152c66a45d71604e Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 10 Jan 2007 21:59:55 +0000 Subject: Add Yum driver git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2642 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/Yum.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/lib/Client/Tools/Yum.py (limited to 'src/lib/Client/Tools/Yum.py') 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() -- cgit v1.2.3-1-g7c22