mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00

MAJOR refactor. The volume is now abstracted into a model along with a partitionmap and partitions. Volumes and partitions are now controlled via an FSM to ensure that commands are called in the proper sequence. GRUB can now be installed properly onto loop devices by using dmsetup to fake a proper harddisk.
17 lines
651 B
Python
17 lines
651 B
Python
|
|
|
|
def load_volume(data):
|
|
from common.fs.loopbackvolume import LoopbackVolume
|
|
from providers.ec2.volume import EBSVolume
|
|
from providers.virtualbox.volume import VirtualBoxVolume
|
|
from partitionmap import PartitionMap
|
|
from nopartitions import NoPartitions
|
|
partition_maps = {'none': NoPartitions,
|
|
'gpt': PartitionMap,
|
|
}
|
|
partition_map = partition_maps.get(data['partitions']['type'])(data['partitions'])
|
|
volume_backings = {'raw': LoopbackVolume,
|
|
'vdi': VirtualBoxVolume,
|
|
'ebs': EBSVolume
|
|
}
|
|
return volume_backings.get(data['backing'])(partition_map)
|