[NEW PATCH] BZ#732765 - Don't return empty strings for 'disktotal'/'diskfree' on unreachable domains during getStoragePoolInfo (via gerrit-bot)

Igor Lvovsky ilvovsky at redhat.com
Wed Aug 31 14:49:05 UTC 2011


New patch submitted by Igor Lvovsky (ilvovsky at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/862

commit 64912aa7e625ad476faac4797f556550b728eccc
Author: Igor Lvovsky <ilvovsky at 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 0de7be6..440a86a 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1063,11 +1063,11 @@ 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'] = ""
+                            # We need to return both of them or none
+                            stats.pop('disktotal', None)
+                            stats.pop('diskfree', None)
                     stats['alerts'] = alerts
 
             stats['status'] = domDict[item]




More information about the vdsm-patches mailing list