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

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Tue Mar 11 07:02:17 UTC 2014


Reviewed-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>

But maybe you should pay more attention to the commit message grammar ;-)

on 2014/03/11 14:34, shaohef at linux.vnet.ibm.com wrote:
> 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))
> 


-- 
Thanks and best regards!

Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397




More information about the Kimchi-devel mailing list