From 22307913a64fb2cc0963f128ea08570a2f896454 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 29 Jan 2012 22:23:45 -0500 Subject: [PATCH] host: If a storage volume error, just hide it Instead of breaking the whole pool view --- src/virtManager/host.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/virtManager/host.py b/src/virtManager/host.py index 568a834ff..032e7b821 100644 --- a/src/virtManager/host.py +++ b/src/virtManager/host.py @@ -874,7 +874,16 @@ class vmmHost(vmmGObjectUI): for key in vols.keys(): 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 try: if path: @@ -885,8 +894,8 @@ class vmmHost(vmmGObjectUI): except: logging.exception("Failed to determine if storage volume in " "use.") - model.append([key, vol.get_name(), vol.get_pretty_capacity(), - vol.get_format() or "", namestr]) + + model.append([key, name, cap, fmt, namestr]) #############################