Reviewed-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
On 03/05/2015 09:50 AM, Aline Manera wrote:
When setting a iSCSI/SCSI pool to a template, the user must also
specify
the volume as those pools are read-only.
But it was not possible when the targeted pool name had non-ASCII
characteres.
That is because the libvirt API is based on string and Kimchi on
unicode. So when using Kimchi internal functions we must use unicode.
To fix it convert the string returned by libvrit API to unicode.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/templates.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index 85f0839..e91636b 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
-# Copyright IBM, Corp. 2014
+# Copyright IBM, Corp. 2014-2015
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -111,7 +111,7 @@ class TemplatesModel(object):
def template_volume_validate(self, tmp_volumes, pool):
kwargs = {'conn': self.conn, 'objstore': self.objstore}
pool_type = xpath_get_text(pool.XMLDesc(0), "/pool/@type")[0]
- pool_name = pool.name()
+ pool_name = unicode(pool.name(), 'utf-8')
# as we discussion, we do not mix disks from 2 different types of
# storage pools, for instance: we do not create a template with 2