summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Frame.py9
-rw-r--r--src/lib/Client/Tools/Yum.py19
-rw-r--r--src/lib/Client/Tools/__init__.py2
3 files changed, 23 insertions, 7 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index ac99c28ba..879ab0be2 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -58,10 +58,6 @@ class Frame:
except ImportError:
continue
- for tool in tools:
- for conflict in getattr(tool, 'conflicts', []):
- del tmods[conflict]
-
for (tool, mod) in tmods.iteritems():
try:
self.tools.append(getattr(mod, tool)(self.logger, setup, config, self.states))
@@ -70,6 +66,11 @@ class Frame:
except:
self.logger.error("Failed to instantiate tool %s" % (tool), exc_info=1)
+ for tool in self.tools[:]:
+ for conflict in getattr(tool, 'conflicts', []):
+ [self.tools.remove(item) for item in self.tools \
+ if item.__name__ == conflict]
+
self.logger.info("Loaded tool drivers:")
self.logger.info([tool.__name__ for tool in self.tools])
if not self.setup['dryrun']:
diff --git a/src/lib/Client/Tools/Yum.py b/src/lib/Client/Tools/Yum.py
index 8d3b0da6b..1f47c827a 100644
--- a/src/lib/Client/Tools/Yum.py
+++ b/src/lib/Client/Tools/Yum.py
@@ -2,14 +2,29 @@
'''This provides bcfg2 support for yum'''
__revision__ = '$Revision$'
-import Bcfg2.Client.Tools.RPM
+import Bcfg2.Client.Tools.RPM, ConfigParser, sys
conflicts = ['RPM']
+YAD = True
+CP = ConfigParser.ConfigParser()
+try:
+ if '-C' in sys.argv:
+ CP.read([sys.argv[sys.argv.index('-C') + 1]])
+ else:
+ CP.read(['/etc/bcfg2.conf'])
+ if CP.get('Yum', 'autodep') == 'false':
+ YAD = False
+except ConfigParser.NoOptionError:
+ pass
+
class Yum(Bcfg2.Client.Tools.RPM.RPM):
'''Support for Yum packages'''
pkgtype = 'yum'
- pkgtool = ("/usr/bin/yum -d0 -y install %s", ("%s-%s", ["name", "version"]))
+ if YAD:
+ pkgtool = ("/usr/bin/yum -d0 -y install %s", ("%s-%s", ["name", "version"]))
+ else:
+ pkgtool = ("/usr/bin/yum -d0 install %s", ("%s-%s", ["name", "version"]))
__name__ = 'Yum'
__execs__ = ['/usr/bin/yum', '/var/lib/rpm']
__handles__ = [('Package', 'yum')]
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 24a629f99..90d3cedbc 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -2,7 +2,7 @@
__revision__ = '$Revision$'
__all__ = ["Action", "APT", "Blast", "Chkconfig", "DebInit", "Encap", "launchd",
- "Portage", "POSIX", "RPM", "RcUpdate", "SMF", "SYSV"]
+ "Portage", "POSIX", "RPM", "RcUpdate", "SMF", "SYSV", "Yum"]
import os, popen2, stat, sys, Bcfg2.Client.XML