If exception is raised when setting pool_uri, a new
exception will be raised trying to print pool_uri
value, which will be undefined.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
Signed-off-by: Gustavo Y. Ribeiro <gyr(a)linux.vnet.ibm.com>
---
plugins/kimchi/model/templates.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/kimchi/model/templates.py b/plugins/kimchi/model/templates.py
index 0f1f6be..a7a74fc 100644
--- a/plugins/kimchi/model/templates.py
+++ b/plugins/kimchi/model/templates.py
@@ -76,7 +76,7 @@ class TemplatesModel(object):
pool_name = pool_name_from_uri(pool_uri)
pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
except Exception:
- raise InvalidParameter("KCHTMPL0004E", {'pool':
pool_name,
+ raise InvalidParameter("KCHTMPL0004E", {'pool':
pool_uri,
'template': name})
tmp_volumes = [disk['volume'] for disk in params.get('disks',
[])
@@ -194,7 +194,7 @@ class TemplateModel(object):
pool_name = pool_name_from_uri(pool_uri)
pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
except Exception:
- raise InvalidParameter("KCHTMPL0004E", {'pool':
pool_name,
+ raise InvalidParameter("KCHTMPL0004E", {'pool':
pool_uri,
'template': name})
tmp_volumes = [disk['volume'] for disk in new_t.get('disks',
[])
if 'volume' in disk]
@@ -239,7 +239,7 @@ class LibvirtVMTemplate(VMTemplate):
conn = self.conn.get()
pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
except libvirt.libvirtError:
- raise InvalidParameter("KCHTMPL0004E", {'pool': pool_name,
+ raise InvalidParameter("KCHTMPL0004E", {'pool': pool_uri,
'template': self.name})
if not pool.isActive():
--
1.7.1