host: If a storage volume error, just hide it

Instead of breaking the whole pool view
This commit is contained in:
Cole Robinson 2012-01-29 22:23:45 -05:00
parent ce694fc76e
commit 22307913a6

View File

@ -874,7 +874,16 @@ class vmmHost(vmmGObjectUI):
for key in vols.keys(): for key in vols.keys():
vol = vols[key] vol = vols[key]
path = vol.get_target_path() try:
path = vol.get_target_path()
name = vol.get_name()
cap = vol.get_pretty_capacity()
fmt = vol.get_format() or ""
except:
logging.debug("Error getting volume info for '%s', "
"hiding it", key, exc_info=True)
continue
namestr = None namestr = None
try: try:
if path: if path:
@ -885,8 +894,8 @@ class vmmHost(vmmGObjectUI):
except: except:
logging.exception("Failed to determine if storage volume in " logging.exception("Failed to determine if storage volume in "
"use.") "use.")
model.append([key, vol.get_name(), vol.get_pretty_capacity(),
vol.get_format() or "", namestr]) model.append([key, name, cap, fmt, namestr])
############################# #############################