diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-01-10 21:59:55 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-01-10 21:59:55 +0000 |
commit | 95b3c04e41a6f0e7497d2f87152c66a45d71604e (patch) | |
tree | 798eb291fab7b4246213817bd991764f35119812 /src/lib/Client/Tools | |
parent | 3cab3bc24a2cff1295eae441c07d650eeb17f31f (diff) | |
download | bcfg2-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')
-rw-r--r-- | src/lib/Client/Tools/Yum.py | 23 | ||||
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 2 |
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 |