[Kimchi-devel] [PATCH] bug fix: Fix shallow scan broken after model refactoring

Aline Manera alinefm at linux.vnet.ibm.com
Mon Feb 3 18:24:15 UTC 2014


From: Aline Manera <alinefm at br.ibm.com>

The shallow scan is always return an empty array as it is trying to
access the pool name as a libvirt pool object.
Fix it to restore shallow scan functionality.

Signed-off-by: Aline Manera <alinefm at br.ibm.com>
---
 src/kimchi/model/storagevolumes.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index 7ff570b..8440a76 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -160,8 +160,9 @@ class IsoVolumesModel(object):
         pools = conn.listStoragePools()
         pools += conn.listDefinedStoragePools()
 
-        for pool in pools:
+        for pool_name in pools:
             try:
+                pool = StoragePoolModel.get_storagepool(pool_name, self.conn)
                 pool.refresh(0)
                 volumes = pool.listVolumes()
             except InvalidOperation:
@@ -169,7 +170,7 @@ class IsoVolumesModel(object):
                 continue
 
             for volume in volumes:
-                res = self.storagevolume.lookup(pool, volume)
+                res = self.storagevolume.lookup(pool_name, volume)
                 if res['format'] == 'iso':
                     res['name'] = '%s' % volume
                     iso_volumes.append(res)
-- 
1.7.10.4




More information about the Kimchi-devel mailing list