[Kimchi-devel] [PATCH] Fix volume not found error message

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Wed Apr 9 03:00:24 UTC 2014


The message 'KCHVOL0002E' expects the storage pool name, however the
backend was passing the libvirt pool object, this makes the user see the
python object string (useless information). This patch corrects this
problem, fixing the duplicated variable name in the source code.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 src/kimchi/model/storagevolumes.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index c524ca3..8a568eb 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -108,8 +108,8 @@ class StorageVolumeModel(object):
         self.conn = kargs['conn']
         self.objstore = kargs['objstore']
 
-    def _get_storagevolume(self, pool, name):
-        pool = StoragePoolModel.get_storagepool(pool, self.conn)
+    def _get_storagevolume(self, poolname, name):
+        pool = StoragePoolModel.get_storagepool(poolname, self.conn)
         if not pool.isActive():
             raise InvalidOperation("KCHVOL0006E", {'name': pool})
         try:
@@ -117,7 +117,7 @@ class StorageVolumeModel(object):
         except libvirt.libvirtError as e:
             if e.get_error_code() == libvirt.VIR_ERR_NO_STORAGE_VOL:
                 raise NotFoundError("KCHVOL0002E", {'name': name,
-                                                    'pool': pool})
+                                                    'pool': poolname})
             else:
                 raise
 
-- 
1.8.5.3




More information about the Kimchi-devel mailing list