Don't 'refresh' pool every time we want to list volumes.

This commit is contained in:
Cole Robinson 2008-09-05 21:53:26 -04:00
parent b93fc2adc1
commit 8438a49599

View File

@ -120,12 +120,14 @@ class vmmStoragePool(gobject.GObject):
def get_volume(self, uuid):
return self._volumes[uuid]
def refresh(self):
self.pool.refresh(0)
def update_volumes(self):
if not self.is_active():
self._volumes = {}
return
self.pool.refresh(0)
vols = self.pool.listVolumes()
new_vol_list = {}
@ -139,6 +141,7 @@ class vmmStoragePool(gobject.GObject):
volname)
self._volumes = new_vol_list
def _prettyify(self, val):
if val > (1024*1024*1024):
return "%2.2f GB" % (val/(1024.0*1024.0*1024.0))