summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools
diff options
context:
space:
mode:
authorJonathan Billings <jsbillin@umich.edu>2014-10-16 12:46:42 -0400
committerJonathan Billings <jsbillin@umich.edu>2014-10-17 08:59:04 -0400
commit234aa9b1c5efc87d71b70e2abc5b422a487ec61e (patch)
tree8d56e6f715cf364e259495f85a61afe238c5a066 /src/lib/Bcfg2/Client/Tools
parent5c68f95a382fdcd17fb5016a98b7eb7af4e057a6 (diff)
downloadbcfg2-234aa9b1c5efc87d71b70e2abc5b422a487ec61e.tar.gz
bcfg2-234aa9b1c5efc87d71b70e2abc5b422a487ec61e.tar.bz2
bcfg2-234aa9b1c5efc87d71b70e2abc5b422a487ec61e.zip
YUM: Add options to enable and disable Yum plugins
Adds two options you can define: * disabled_plugins: A comma-separated list of plugins to disable * enabled_plugins: A comma-separated list of plugins to enable This allows you to run bcfg2 with certain plugins enabled or disabled when they're not set that way in the yum configuration. This is useful because the Bcfg2 YUM plugin is initialized before it can read in any files that might overwrite yum plugin configuration.
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools')
-rw-r--r--src/lib/Bcfg2/Client/Tools/YUM.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/YUM.py b/src/lib/Bcfg2/Client/Tools/YUM.py
index 15ae5ef8b..a584fec86 100644
--- a/src/lib/Bcfg2/Client/Tools/YUM.py
+++ b/src/lib/Bcfg2/Client/Tools/YUM.py
@@ -191,6 +191,10 @@ class YUM(Bcfg2.Client.Tools.PkgTool):
self.logger.debug("Yum: Reinstall on verify fail: %s" % self.do_reinst)
self.logger.debug("Yum: installonlypkgs: %s" % self.installonlypkgs)
self.logger.debug("Yum: verify_flags: %s" % self.verify_flags)
+ self.logger.debug("Yum: disabled_plugins: %s" %
+ self.setup["yum_disabled_plugins"])
+ self.logger.debug("Yum: enabled_plugins: %s" %
+ self.setup["yum_enabled_plugins"])
def _loadYumBase(self, setup=None, logger=None):
''' this may be called before PkgTool.__init__() is called on
@@ -216,6 +220,12 @@ class YUM(Bcfg2.Client.Tools.PkgTool):
else:
debuglevel = 0
+ if setup['yum_disabled_plugins']:
+ rv.preconf.disabled_plugins = setup['yum_disabled_plugins']
+
+ if setup['yum_enabled_plugins']:
+ rv.preconf.enabled_plugins = setup['yum_enabled_plugins']
+
# pylint: disable=E1121,W0212
try:
rv.preconf.debuglevel = debuglevel