Delete image after use, apparently the vbox version of delete is to do nothing

This commit is contained in:
Anders Ingemann 2015-01-16 01:50:27 +01:00
parent bd4cf250a2
commit 87f2d889b7
2 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,12 @@ class VirtualBoxImage(Image):
log.debug('Closing vbox medium `{path}\''.format(path=self.image_path))
self.medium.close()
def destroy(self):
log.debug('Deleting vbox image `{path}\''.format(path=self.image_path))
import os
os.remove(self.image_path)
del self.image_path
def get_instance(self):
import hashlib
from ..instances.virtualbox import VirtualBoxInstance

View file

@ -55,3 +55,4 @@ class BootableManifest(object):
self.instance.down()
if hasattr(self, 'image'):
self.image.close()
self.image.destroy()