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

Shu Ming shuming at linux.vnet.ibm.com
Tue Mar 11 07:06:39 UTC 2014


Reviewed-by: Shu Ming <shuming at linux.vnet.ibm.com>
2014/3/11 14:34, shaohef at linux.vnet.ibm.com :
> 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))
>




More information about the Kimchi-devel mailing list