[Kimchi-devel] [PATCH] [Kimchi 1/3] Fix template creation from image file

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Tue Apr 5 01:01:59 UTC 2016


Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
 vmtemplate.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vmtemplate.py b/vmtemplate.py
index 653ad02..b610d0c 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -96,7 +96,11 @@ class VMTemplate(object):
         for index, disk in enumerate(disks):
             disk_info = dict(default_disk)
 
-            pool_type = self._get_storage_type(disk['pool']['name'])
+            pool_name = '/plugins/kimchi/storagepools/default'
+            if 'pool' in disk and 'name' in disk['pool']:
+                pool_name = disk['pool']['name']
+
+            pool_type = self._get_storage_type(pool_name)
             if pool_type in ['iscsi', 'scsi']:
                 disk_info = {'index': 0, 'format': 'raw', 'volume': None}
 
-- 
1.9.1




More information about the Kimchi-devel mailing list