From 8e501a8589db2c5f29a43b5fb2d253c431397b4f Mon Sep 17 00:00:00 2001 From: Stefan Sicleru Date: Mon, 26 Sep 2016 14:09:09 +0200 Subject: deploy: fix: remove storage files during cleanup Remove old disks through virsh instead of calling os.delete() methods so that the cleanup phase would succeed within a non-root setup. [1] Related-bug: ARMBAND-128 [1] https://gerrit.opnfv.org/gerrit/#/c/19491/ Change-Id: I90007edf014c7e15a68b9a334fcaffaa127ee4ab Signed-off-by: Stefan Sicleru (cherry picked from commit d4f9612475a07773af182f244bcd597d25bf4cd8) --- deploy/environments/execution_environment.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deploy/environments/execution_environment.py b/deploy/environments/execution_environment.py index af0e130dd..3812902aa 100644 --- a/deploy/environments/execution_environment.py +++ b/deploy/environments/execution_environment.py @@ -46,9 +46,7 @@ class ExecutionEnvironment(object): disk_files.append(source_file) log('Deleting VM %s with disks %s' % (vm_name, disk_files)) exec_cmd('virsh destroy %s' % vm_name, False) - exec_cmd('virsh undefine %s' % vm_name, False) - for file in disk_files: - delete(file) + exec_cmd('virsh undefine --managed-save --remove-all-storage %s' % vm_name, False) def overwrite_xml(self, vm_xml, vm_definition_overwrite): if not vm_definition_overwrite: -- cgit 1.2.3-korg