summaryrefslogtreecommitdiff
path: root/virtinst/connection.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2015-04-10 12:52:42 -0400
committerCole Robinson <crobinso@redhat.com>2015-04-10 15:00:34 -0400
commit838baf694633813ea3f6593356d5e744fbb9ea96 (patch)
treebce67b07a6cf443016b21fd87fffee32e271c063 /virtinst/connection.py
parent5357b91402fb7a8a73921216926908c08f6ad99d (diff)
downloadvirt-manager-838baf694633813ea3f6593356d5e744fbb9ea96.tar.gz
connection: tick: Operate on combined object lists
Makes the flow a bit simpler, and allows us to break out polling without having to pass around a ton of lists.
Diffstat (limited to 'virtinst/connection.py')
-rw-r--r--virtinst/connection.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/virtinst/connection.py b/virtinst/connection.py
index 7aabfaf8..6f0decab 100644
--- a/virtinst/connection.py
+++ b/virtinst/connection.py
@@ -193,10 +193,10 @@ class VirtualConnection(object):
if key in self._fetch_cache:
return self._fetch_cache[key]
- ignore, ignore, ret = pollhelpers.fetch_vms(self, {},
- lambda obj, ignore: obj)
+ ignore, ignore, ret = pollhelpers.fetch_vms(
+ self, {}, lambda obj, ignore: obj)
ret = [Guest(weakref.ref(self), parsexml=obj.XMLDesc(0))
- for obj in ret.values()]
+ for obj in ret]
if self.cache_object_fetch:
self._fetch_cache[key] = ret
return ret
@@ -214,10 +214,10 @@ class VirtualConnection(object):
if key in self._fetch_cache:
return self._fetch_cache[key]
- ignore, ignore, ret = pollhelpers.fetch_pools(self, {},
- lambda obj, ignore: obj)
+ ignore, ignore, ret = pollhelpers.fetch_pools(
+ self, {}, lambda obj, ignore: obj)
ret = [StoragePool(weakref.ref(self), parsexml=obj.XMLDesc(0))
- for obj in ret.values()]
+ for obj in ret]
if self.cache_object_fetch:
self._fetch_cache[key] = ret
return ret
@@ -244,7 +244,7 @@ class VirtualConnection(object):
ignore, ignore, vols = pollhelpers.fetch_volumes(
self, pool, {}, lambda obj, ignore: obj)
- for vol in vols.values():
+ for vol in vols:
try:
xml = vol.XMLDesc(0)
ret.append(StorageVolume(weakref.ref(self), parsexml=xml))
@@ -271,7 +271,7 @@ class VirtualConnection(object):
ignore, ignore, ret = pollhelpers.fetch_nodedevs(
self, {}, lambda obj, ignore: obj)
ret = [NodeDevice.parse(weakref.ref(self), obj.XMLDesc(0))
- for obj in ret.values()]
+ for obj in ret]
if self.cache_object_fetch:
self._fetch_cache[key] = ret
return ret