summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-12-22 04:09:48 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-12-22 04:09:48 +0000
commite3fb140c8d44d751766535eedefcc4ada6544bd1 (patch)
tree9cfe7aa923ec2b1f2e17df1ced892508987b9a6f /src/lib/Client/Tools
parent5ab6c7a56e1cb16fee6b04a2b74e615f8f4c557e (diff)
downloadbcfg2-e3fb140c8d44d751766535eedefcc4ada6544bd1.tar.gz
bcfg2-e3fb140c8d44d751766535eedefcc4ada6544bd1.tar.bz2
bcfg2-e3fb140c8d44d751766535eedefcc4ada6544bd1.zip
Update dictionary accesses to work with Python 3.0
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4999 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r--src/lib/Client/Tools/APT.py4
-rw-r--r--src/lib/Client/Tools/FreeBSDPackage.py4
-rw-r--r--src/lib/Client/Tools/Portage.py4
-rw-r--r--src/lib/Client/Tools/RPM.py2
-rw-r--r--src/lib/Client/Tools/RPMng.py2
-rw-r--r--src/lib/Client/Tools/SMF.py2
-rw-r--r--src/lib/Client/Tools/Yum.py2
-rwxr-xr-xsrc/lib/Client/Tools/rpmtools.py4
8 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 1acd70cae..231b69adb 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -87,7 +87,7 @@ class APT(Bcfg2.Client.Tools.Tool):
def VerifyPackage(self, entry, modlist, checksums=True):
'''Verify package for entry'''
- if not entry.attrib.has_key('version'):
+ if not 'version' in entry.attrib:
self.logger.info("Cannot verify unversioned package %s" %
(entry.attrib['name']))
return False
@@ -140,7 +140,7 @@ class APT(Bcfg2.Client.Tools.Tool):
ipkgs = []
bad_pkgs = []
for pkg in packages:
- if not self.pkg_cache.has_key(pkg.get('name')):
+ if not pkg.get('name') in self.pkg_cache:
self.logger.error("APT has no information about package %s" % (pkg.get('name')))
continue
if pkg.get('version') == 'auto':
diff --git a/src/lib/Client/Tools/FreeBSDPackage.py b/src/lib/Client/Tools/FreeBSDPackage.py
index 117873c9f..dbd32a122 100644
--- a/src/lib/Client/Tools/FreeBSDPackage.py
+++ b/src/lib/Client/Tools/FreeBSDPackage.py
@@ -29,11 +29,11 @@ class FreeBSDPackage(Bcfg2.Client.Tools.PkgTool):
self.installed[name] = version
def VerifyPackage(self, entry, modlist):
- if not entry.attrib.has_key('version'):
+ if not 'version' in entry.attrib:
self.logger.info("Cannot verify unversioned package %s" %
(entry.attrib['name']))
return False
- if self.installed.has_key(entry.attrib['name']):
+ if entry.attrib['name'] in self.installed:
if self.installed[entry.attrib['name']] == entry.attrib['version']:
# TODO: verfification
return True
diff --git a/src/lib/Client/Tools/Portage.py b/src/lib/Client/Tools/Portage.py
index b0599a60a..936dc25cb 100644
--- a/src/lib/Client/Tools/Portage.py
+++ b/src/lib/Client/Tools/Portage.py
@@ -35,11 +35,11 @@ class Portage(Bcfg2.Client.Tools.PkgTool):
def VerifyPackage(self, entry, modlist):
'''Verify package for entry'''
- if not entry.attrib.has_key('version'):
+ if not 'version' in entry.attrib:
self.logger.info("Cannot verify unversioned package %s" %
(entry.attrib['name']))
return False
- if self.installed.has_key(entry.attrib['name']):
+ if entry.attrib['name'] in self.installed:
if self.installed[entry.attrib['name']] == entry.attrib['version']:
if not self.setup['quick'] and \
entry.get('verify', 'true') == 'true':
diff --git a/src/lib/Client/Tools/RPM.py b/src/lib/Client/Tools/RPM.py
index be8bb95b9..1ccffb4a8 100644
--- a/src/lib/Client/Tools/RPM.py
+++ b/src/lib/Client/Tools/RPM.py
@@ -40,7 +40,7 @@ class RPM(Bcfg2.Client.Tools.PkgTool):
self.logger.debug("Skipping mtime verification for package %s" % \
(entry.get('name')))
rpm_options.append("--nomtime")
- if self.installed.has_key(entry.get('name')):
+ if entry.get('name') in self.installed:
if entry.get('version') == self.installed[entry.get('name')]:
if entry.get('multiarch'):
archs = entry.get('multiarch').split()
diff --git a/src/lib/Client/Tools/RPMng.py b/src/lib/Client/Tools/RPMng.py
index 1a7a0e21f..fd440e415 100644
--- a/src/lib/Client/Tools/RPMng.py
+++ b/src/lib/Client/Tools/RPMng.py
@@ -192,7 +192,7 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
package_fail = False
qtext_versions = ''
- if self.installed.has_key(entry.get('name')):
+ if entry.get('name') in self.installed:
# There is at least one instance installed.
if self.pkg_checks == 'true' and entry.get('pkg_checks', 'true') == 'true':
if entry.get('name') in self.installOnlyPkgs:
diff --git a/src/lib/Client/Tools/SMF.py b/src/lib/Client/Tools/SMF.py
index 28f6c830c..399418986 100644
--- a/src/lib/Client/Tools/SMF.py
+++ b/src/lib/Client/Tools/SMF.py
@@ -14,7 +14,7 @@ class SMF(Bcfg2.Client.Tools.Tool):
def GetFMRI(self, entry):
'''Perform FMRI resolution for service'''
- if not entry.attrib.has_key('FMRI'):
+ if not 'FMRI' in entry.attrib:
name = self.cmd.run("/usr/bin/svcs -H -o FMRI %s 2>/dev/null" % \
entry.get('name'))[1]
if name:
diff --git a/src/lib/Client/Tools/Yum.py b/src/lib/Client/Tools/Yum.py
index 0986fca33..73506af14 100644
--- a/src/lib/Client/Tools/Yum.py
+++ b/src/lib/Client/Tools/Yum.py
@@ -43,5 +43,5 @@ class Yum(Bcfg2.Client.Tools.RPM.RPM):
def VerifyPackage(self, entry, modlist):
if entry.get('version') == 'noverify':
- return self.installed.has_key(entry.get('name'))
+ return entry.get('name') in self.installed
return Bcfg2.Client.Tools.RPM.RPM.VerifyPackage(self, entry, modlist)
diff --git a/src/lib/Client/Tools/rpmtools.py b/src/lib/Client/Tools/rpmtools.py
index d751270e6..8e3473239 100755
--- a/src/lib/Client/Tools/rpmtools.py
+++ b/src/lib/Client/Tools/rpmtools.py
@@ -184,7 +184,7 @@ def getindexbykeyword(index_ts, **kwargs):
else:
index_mi = index_ts.dbMatch()
- if kwargs.has_key('epoch'):
+ if 'epoch' in kwargs:
if kwargs['epoch'] != None and kwargs['epoch'] != 'None':
kwargs['epoch'] = int(kwargs['epoch'])
else:
@@ -222,7 +222,7 @@ def getheadersbykeyword(header_ts, **kwargs):
else:
header_mi = header_ts.dbMatch()
- if kwargs.has_key('epoch'):
+ if 'epoch' in kwargs:
if kwargs['epoch'] != None and kwargs['epoch'] != 'None':
kwargs['epoch'] = int(kwargs['epoch'])
else: