New patch submitted by Igor Lvovsky (ilvovsky(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/862
commit d9e65876c7e35379a535762505692001c2b7387a
Author: Igor Lvovsky <ilvovsky(a)redhat.com>
Date: Mon Aug 29 12:54:56 2011 +0300
BZ#732765 - Don't return empty strings for 'disktotal'/'diskfree'
on unreachable domains during getStoragePoolInfo
Change-Id: I64ae55b4942cf5748d3d8ada445a3381498ea258
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 4fbf95f..b381936 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1072,11 +1072,13 @@ class StoragePool:
try:
stats.update(SDF.produce(item).getStats())
except:
- self.log.error("Could get information for domain
`%s`", item, exc_info=True)
+ self.log.error("Could not get information for domain
%s", item, exc_info=True)
# Domain is unavailable and we have nothing in the cache
- # Return defaults
- stats['disktotal'] = ""
- stats['diskfree'] = ""
+ try:
+ del(stats['disktotal'])
+ del(stats['diskfree'])
+ except KeyError:
+ pass
stats['alerts'] = alerts
stats['status'] = domDict[item]