summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/Yum.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-02-01 19:44:45 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-02-01 19:44:45 +0000
commit76d825e024588dc0aef9bde910b17d2175f266f2 (patch)
tree2afd0775fbeb3d9d684ef31aa847bdbc490a5247 /src/lib/Client/Tools/Yum.py
parentae992d98aa69fa9fd6feb47ebc0da41800b36df3 (diff)
downloadbcfg2-76d825e024588dc0aef9bde910b17d2175f266f2.tar.gz
bcfg2-76d825e024588dc0aef9bde910b17d2175f266f2.tar.bz2
bcfg2-76d825e024588dc0aef9bde910b17d2175f266f2.zip
Implement complete Yum solution
* Add Yum into default loaded drivers * Add support for Yum to not use -y * Fix driver conflict setup git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2754 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/Yum.py')
-rw-r--r--src/lib/Client/Tools/Yum.py19
1 files changed, 17 insertions, 2 deletions
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')]