[Kimchi-devel] [PATCH 2/5] Bug fix: Allow clonning a volume from a pool with non-ASCII characters

Aline Manera alinefm at linux.vnet.ibm.com
Thu Jan 22 14:36:50 UTC 2015


All the data received from server is in unicode format, so we need to
encode to UTF-8 to get the right data value.

The functions StorageVolumeModel.get_storagevolume() and StoragePoolModel.get_storagepool()
used by clone() function also expects unicode values and then do the
encoding to UTF-8 so on clone() function there is nothing to do related
to encoding.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/model/storagevolumes.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index 6fbb8b4..0480496 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -398,9 +398,6 @@ class StorageVolumeModel(object):
         Return:
         A Task running the clone operation.
         """
-        pool = pool.decode('utf-8')
-        name = name.decode('utf-8')
-
         # the same pool will be used if no pool is specified
         if new_pool is None:
             new_pool = pool
@@ -435,10 +432,10 @@ class StorageVolumeModel(object):
             "new_pool": The name of the destination pool.
             "new_name": The name of the new volume.
         """
-        orig_pool_name = params['pool'].decode('utf-8')
-        orig_vol_name = params['name'].decode('utf-8')
-        new_pool_name = params['new_pool'].decode('utf-8')
-        new_vol_name = params['new_name'].decode('utf-8')
+        orig_pool_name = params['pool']
+        orig_vol_name = params['name']
+        new_pool_name = params['new_pool']
+        new_vol_name = params['new_name']
 
         try:
             cb('setting up volume cloning')
-- 
2.1.0




More information about the Kimchi-devel mailing list