mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00

In practice they are just typed functions with attributes, having a reference to an object is just confusing. So: Task.run() is now a classmethod
35 lines
798 B
Python
35 lines
798 B
Python
from base import Task
|
|
from common import phases
|
|
import filesystem
|
|
import volume
|
|
|
|
|
|
class PartitionVolume(Task):
|
|
description = 'Partitioning the volume'
|
|
phase = phases.volume_preparation
|
|
|
|
@classmethod
|
|
def run(cls, info):
|
|
info.volume.partition_map.create(info.volume)
|
|
|
|
|
|
class MapPartitions(Task):
|
|
description = 'Mapping volume partitions'
|
|
phase = phases.volume_preparation
|
|
predecessors = [PartitionVolume]
|
|
successors = [filesystem.Format]
|
|
|
|
@classmethod
|
|
def run(cls, info):
|
|
info.volume.partition_map.map(info.volume)
|
|
|
|
|
|
class UnmapPartitions(Task):
|
|
description = 'Removing volume partitions mapping'
|
|
phase = phases.volume_unmounting
|
|
predecessors = [filesystem.UnmountRoot]
|
|
successors = [volume.Detach]
|
|
|
|
@classmethod
|
|
def run(cls, info):
|
|
info.volume.partition_map.unmap(info.volume)
|