mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
create: Don't traceback errors in host space tick
This commit is contained in:
parent
004623a886
commit
0973e6c31a
@ -376,6 +376,7 @@ class vmmAddHardware(vmmGObjectUI):
|
|||||||
def reset_state(self):
|
def reset_state(self):
|
||||||
# Storage init
|
# Storage init
|
||||||
label_widget = self.window.get_widget("phys-hd-label")
|
label_widget = self.window.get_widget("phys-hd-label")
|
||||||
|
label_widget.set_markup("")
|
||||||
if not self.host_storage_timer:
|
if not self.host_storage_timer:
|
||||||
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
|
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
|
||||||
uihelpers.host_space_tick,
|
uihelpers.host_space_tick,
|
||||||
|
@ -348,6 +348,7 @@ class vmmCreate(vmmGObjectUI):
|
|||||||
|
|
||||||
# Storage
|
# Storage
|
||||||
label_widget = self.window.get_widget("phys-hd-label")
|
label_widget = self.window.get_widget("phys-hd-label")
|
||||||
|
label_widget.set_markup("")
|
||||||
if not self.host_storage_timer:
|
if not self.host_storage_timer:
|
||||||
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
|
self.host_storage_timer = util.safe_timeout_add(3 * 1000,
|
||||||
uihelpers.host_space_tick,
|
uihelpers.host_space_tick,
|
||||||
|
@ -85,7 +85,11 @@ def host_disk_space(conn):
|
|||||||
return float(avail / 1024.0 / 1024.0 / 1024.0)
|
return float(avail / 1024.0 / 1024.0 / 1024.0)
|
||||||
|
|
||||||
def host_space_tick(conn, widget):
|
def host_space_tick(conn, widget):
|
||||||
|
try:
|
||||||
max_storage = host_disk_space(conn)
|
max_storage = host_disk_space(conn)
|
||||||
|
except:
|
||||||
|
logging.exception("Error determining host disk space")
|
||||||
|
return 0
|
||||||
|
|
||||||
def pretty_storage(size):
|
def pretty_storage(size):
|
||||||
return "%.1f Gb" % float(size)
|
return "%.1f Gb" % float(size)
|
||||||
|
Loading…
Reference in New Issue
Block a user