bootstrap-vz/providers/ec2/tasks/ebs.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

27 lines
599 B
Python

from base import Task
from common import phases
class Create(Task):
description = 'Creating the EBS volume'
phase = phases.volume_creation
def run(self, info):
info.volume.create(info.connection, info.host['availabilityZone'])
class Attach(Task):
description = 'Attaching the volume'
phase = phases.volume_creation
predecessors = [Create]
def run(self, info):
info.volume.attach(info.host['instanceId'])
class Snapshot(Task):
description = 'Creating a snapshot of the EBS volume'
phase = phases.image_registration
def run(self, info):
info.snapshot = info.volume.snapshot()