diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-07-10 16:00:28 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-07-10 16:00:28 +0000 |
commit | ca680aea4056f35ae275187557ca153b0e0d55a8 (patch) | |
tree | 4835d444258dd0668572719aa8b21d9674b6ef30 /src/lib | |
parent | a3a2af1ef7a59f40a664ea31914670b94ab4191a (diff) | |
download | bcfg2-ca680aea4056f35ae275187557ca153b0e0d55a8.tar.gz bcfg2-ca680aea4056f35ae275187557ca153b0e0d55a8.tar.bz2 bcfg2-ca680aea4056f35ae275187557ca153b0e0d55a8.zip |
Two bugfixes from Ti's bugreports
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1920 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Client/Redhat.py | 2 | ||||
-rw-r--r-- | src/lib/Client/Toolset.py | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/Client/Redhat.py b/src/lib/Client/Redhat.py index 3eb3b2a6e..c38778454 100644 --- a/src/lib/Client/Redhat.py +++ b/src/lib/Client/Redhat.py @@ -99,7 +99,7 @@ class ToolsetImpl(Toolset): if entry.get('version') == self.installed[entry.get('name')]: if entry.get('multiarch'): archs = entry.get('multiarch').split() - info = self.saferun('rpm -q %s --qf "%{NAME} %{VERSION}-%{RELEASE} %{ARCH}\n"' % (entry.get('name')))[1] + info = self.saferun('rpm -q %s --qf "%%{NAME} %%{VERSION}-%%{RELEASE} %%{ARCH}\n"' % (entry.get('name')))[1] while info: (_, vers, arch) = info.pop() if arch in archs: diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index 598ec9293..4035402b8 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -191,7 +191,11 @@ class Toolset(object): failures = [key for key in ent.attrib if key[:8] == 'current_'] for fail in failures: for field in [fail, fail[8:]]: - newent.set(field, ent.get(field)) + try: + newent.set(field, ent.get(field)) + except TypeError: + self.logger.error("Failed to set field %s for entry %s, value" % + (field, ent.get('name'), ent.get(field))) if 'severity' in ent.attrib: newent.set('severity', ent.get('severity')) #if ent.tag not in ['Package', 'Service', 'SymLink', 'ConfigFile']: @@ -207,7 +211,11 @@ class Toolset(object): failures = [key for key in ent.attrib if key[:8] == 'current_'] for fail in failures: for field in [fail, fail[8:]]: - newent.set(field, ent.get(field)) + try: + newent.set(field, ent.get(field)) + except TypeError: + self.logger.error("Failed to set field %s for entry %s, value" % + (field, ent.get('name'), ent.get(field))) if 'severity' in ent.attrib: newent.set('severity', ent.get('severity')) if self.extra_services + self.pkgwork['remove']: |