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.
26 lines
456 B
Python
26 lines
456 B
Python
from base import Task
|
|
from common import phases
|
|
|
|
|
|
class Attach(Task):
|
|
description = 'Attaching the volume'
|
|
phase = phases.volume_creation
|
|
|
|
def run(self, info):
|
|
info.volume.attach()
|
|
|
|
|
|
class Detach(Task):
|
|
description = 'Detaching the volume'
|
|
phase = phases.volume_unmounting
|
|
|
|
def run(self, info):
|
|
info.volume.detach()
|
|
|
|
|
|
class Delete(Task):
|
|
description = 'Deleting the volume'
|
|
phase = phases.cleaning
|
|
|
|
def run(self, info):
|
|
info.volume.delete()
|