aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorStefan Sicleru <stefan.sicleru@enea.com>2016-09-26 14:09:09 +0200
committerStefan Sicleru <stefan.sicleru@enea.com>2016-09-28 14:01:01 +0000
commit8e501a8589db2c5f29a43b5fb2d253c431397b4f (patch)
tree14b2590fd3178f27cc405a83a4504a2509b5f53e /deploy
parentd53f15a6dacb5e3d3fd58002692f9c08256ff1e9 (diff)
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 <stefan.sicleru@enea.com> (cherry picked from commit d4f9612475a07773af182f244bcd597d25bf4cd8)
Diffstat (limited to 'deploy')
-rw-r--r--deploy/environments/execution_environment.py4
1 files changed, 1 insertions, 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: