[Kimchi-devel] [PATCH] Fix rollback order
Royce Lv
lvroyce at linux.vnet.ibm.com
Fri Mar 7 10:06:33 UTC 2014
Reviewed-by: Royce Lv<lvroyce at linux.vnet.ibm.com>
On 2014年03月07日 02:06, Rodrigo Trujillo wrote:
> This patch changes the order of two rollback calls, avoiding the chance of
> tests left a test file or a test vm in the system.
>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
> ---
> tests/test_model.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/test_model.py b/tests/test_model.py
> index f849039..1fa40fa 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -179,10 +179,10 @@ class ModelTests(unittest.TestCase):
> iso_path = '/tmp/existent.iso'
> iso_path2 = '/tmp/existent2.iso'
> open(iso_path, 'w').close()
> - open(iso_path2, 'w').close()
> - wrong_iso_path = '/nonexistent.iso'
> rollback.prependDefer(os.remove, iso_path)
> + open(iso_path2, 'w').close()
> rollback.prependDefer(os.remove, iso_path2)
> + wrong_iso_path = '/nonexistent.iso'
>
> # Create a cdrom
> cdrom_args = {"type": "cdrom",
> @@ -546,9 +546,9 @@ class ModelTests(unittest.TestCase):
> params_1 = {'name': 'kimchi-vm1', 'template': '/templates/test'}
> params_2 = {'name': 'kimchi-vm2', 'template': '/templates/test'}
> inst.vms_create(params_1)
> - inst.vms_create(params_2)
> rollback.prependDefer(self._rollback_wrapper, inst.vm_delete,
> 'kimchi-vm1')
> + inst.vms_create(params_2)
> rollback.prependDefer(self._rollback_wrapper, inst.vm_delete,
> 'kimchi-vm2')
>
More information about the Kimchi-devel
mailing list