mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
25 lines
669 B
Python
25 lines
669 B
Python
|
|
|
|
class Image(object):
|
|
|
|
def __init__(self, manifest):
|
|
self.manifest = manifest
|
|
|
|
def destroy(self):
|
|
pass
|
|
|
|
|
|
class VirtualBoxImage(Image):
|
|
|
|
def __init__(self, manifest, image_path):
|
|
super(VirtualBoxImage, self).__init__(manifest)
|
|
self.image_path = image_path
|
|
self.medium = self.vbox.open_medium(location=self.image.image_path,
|
|
decive_type=self.vbox.library.DeviceType.HardDisk,
|
|
access_mode=self.vbox.library.AccessMode.read_only,
|
|
force_new_uuid=False)
|
|
|
|
def destroy(self):
|
|
self.medium.delete_storage()
|
|
import os
|
|
os.remove(self.image_path)
|