bootstrap-vz/common/tasks/volume.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

28 lines
533 B
Python

from base import Task
from common import phases
from common.tasks import workspace
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
successors = [workspace.DeleteWorkspace]
def run(self, info):
info.volume.delete()