create: Don't traceback errors in host space tick

This commit is contained in:
Cole Robinson 2010-12-13 16:12:55 -05:00
parent 004623a886
commit 0973e6c31a
3 changed files with 7 additions and 1 deletions

View File

@ -376,6 +376,7 @@ class vmmAddHardware(vmmGObjectUI):
def reset_state(self):
# Storage init
label_widget = self.window.get_widget("phys-hd-label")
label_widget.set_markup("")
if not self.host_storage_timer:
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
uihelpers.host_space_tick,

View File

@ -348,6 +348,7 @@ class vmmCreate(vmmGObjectUI):
# Storage
label_widget = self.window.get_widget("phys-hd-label")
label_widget.set_markup("")
if not self.host_storage_timer:
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
uihelpers.host_space_tick,

View File

@ -85,7 +85,11 @@ def host_disk_space(conn):
return float(avail / 1024.0 / 1024.0 / 1024.0)
def host_space_tick(conn, widget):
try:
max_storage = host_disk_space(conn)
except:
logging.exception("Error determining host disk space")
return 0
def pretty_storage(size):
return "%.1f Gb" % float(size)