summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-09-29 01:34:26 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-09-29 01:34:26 +0000
commitacf1ea7afffae0f5b8aa2e857e258ad6eb328958 (patch)
tree182dc728f7656ddfec0bd4d22555e366e1b4d791
parent3ef49c0a67e99c24ef804b8e4e696f3705edc86e (diff)
downloadbcfg2-acf1ea7afffae0f5b8aa2e857e258ad6eb328958.tar.gz
bcfg2-acf1ea7afffae0f5b8aa2e857e258ad6eb328958.tar.bz2
bcfg2-acf1ea7afffae0f5b8aa2e857e258ad6eb328958.zip
Fix RPM.Refresh when rpm is already in use (Resolves Ticket #134)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2342 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Client/Redhat.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Client/Redhat.py b/src/lib/Client/Redhat.py
index 848219b98..342f642e5 100644
--- a/src/lib/Client/Redhat.py
+++ b/src/lib/Client/Redhat.py
@@ -32,8 +32,13 @@ class ToolsetImpl(Toolset):
'''Refresh memory hashes of packages'''
self.installed = {}
for line in self.saferun("rpm -qa --qf '%{NAME} %{VERSION}-%{RELEASE}\n'")[1]:
- (name, version) = line.split()
- self.installed[name] = version
+ try:
+ (name, version) = line.split()
+ self.installed[name] = version
+ except ValueError:
+ self.logger.error("RPM database already in use; waiting 30 seconds and retrying")
+ time.sleep(30)
+ return self.Refresh()
def VerifyService(self, entry):
'''Verify Service status for entry'''