bootstrap-vz/common/tasks/partitioning.py
Anders Ingemann 663b868b41 Fix #107. Rename before and after task properties
`before' becomes `successors' and `after' becomes `predecessors'
2013-11-22 09:03:47 +01:00

32 lines
759 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
def run(self, info):
info.volume.partition_map.create(info.volume)
class MapPartitions(Task):
description = 'Mapping volume partitions'
phase = phases.volume_preparation
predecessors = [PartitionVolume]
successors = [filesystem.Format]
def run(self, 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]
def run(self, info):
info.volume.partition_map.unmap(info.volume)