From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Storage volume list return value and lookup parameter is not properly
encode and decode, fix it.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/model/storagevolumes.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index e3f00ca..20c65b9 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -79,7 +79,7 @@ class StorageVolumesModel(object):
raise InvalidOperation("KCHVOL0006E", {'pool': pool_name})
try:
pool.refresh(0)
- return pool.listVolumes()
+ return sorted(map(lambda x: x.decode('utf-8'), pool.listVolumes()))
except libvirt.libvirtError as e:
raise OperationFailed("KCHVOL0008E",
{'pool': pool_name,
@@ -95,7 +95,7 @@ class StorageVolumeModel(object):
if not pool.isActive():
raise InvalidOperation("KCHVOL0006E", {'name': pool})
try:
- return pool.storageVolLookupByName(name)
+ return pool.storageVolLookupByName(name.encode("utf-8"))
except libvirt.libvirtError as e:
if e.get_error_code() == libvirt.VIR_ERR_NO_STORAGE_VOL:
raise NotFoundError("KCHVOL0002E", {'name': name,
--
1.8.1.2