On 04/04/2016 10:01 PM, Jose Ricardo Ziviani wrote:
Signed-off-by: Jose Ricardo Ziviani
<joserz(a)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'
Why are you assuming this pool as default?
The default pool come from osinfo and may be changed by user according
to template.conf file, so assuming that may cause problems in case user
changed the default pool in some way.
+ 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}