[Kimchi-devel] [PATCH] bug fix: remove the hard code of disk_path

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Tue Mar 11 06:34:48 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

Usually the path of default pool is under /var/lib/libvirt/images/
But that not means it always is.

So remove this hard code.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 tests/test_model.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test_model.py b/tests/test_model.py
index d661247..75cfc45 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -241,7 +241,8 @@ class ModelTests(unittest.TestCase):
             rollback.prependDefer(inst.vm_delete, 'test-vm-1')
 
             vm_info = inst.vm_lookup(params['name'])
-            disk_path = '/var/lib/libvirt/images/%s-0.img' % vm_info['uuid']
+            disk_path = '%s/%s-0.img' % (
+                inst.storagepool_lookup('default')['path'], vm_info['uuid'])
             self.assertTrue(os.access(disk_path, os.F_OK))
         self.assertFalse(os.access(disk_path, os.F_OK))
 
-- 
1.8.4.2




More information about the Kimchi-devel mailing list