Put task class properties in identical order

This commit is contained in:
Anders Ingemann 2013-07-09 20:32:50 +02:00
parent 1acd86a85a
commit 4e2503ad9c
2 changed files with 5 additions and 10 deletions

View file

@ -6,12 +6,11 @@ import time
class CreateVolumeFromSnapshot(Task):
description = 'Creating EBS volume from a snapshot'
phase = phases.volume_creation
after = [connection.Connect]
before = [ebs.AttachVolume]
description = 'Creating EBS volume from a snapshot'
def run(self, info):
volume_size = int(info.manifest.volume['size']/1024)
snapshot = info.manifest.plugins['prebootstrapped']['snapshot']

View file

@ -6,9 +6,8 @@ import time
class CreateVolume(Task):
phase = phases.volume_creation
description = 'Creating an EBS volume for bootstrapping'
phase = phases.volume_creation
def run(self, info):
volume_size = int(info.manifest.volume['size']/1024)
@ -20,11 +19,10 @@ class CreateVolume(Task):
class AttachVolume(Task):
description = 'Attaching the EBS volume'
phase = phases.volume_creation
after = [CreateVolume]
description = 'Attaching the EBS volume'
def run(self, info):
def char_range(c1, c2):
"""Generates the characters from `c1` to `c2`, inclusive."""
@ -49,11 +47,10 @@ class AttachVolume(Task):
class DetachVolume(Task):
description = 'Detaching the EBS volume'
phase = phases.volume_unmounting
after = [UnmountVolume]
description = 'Detaching the EBS volume'
def run(self, info):
info.volume.detach()
while info.volume.attachment_state() is not None:
@ -73,11 +70,10 @@ class CreateSnapshot(Task):
class DeleteVolume(Task):
description = 'Deleting the EBS volume'
phase = phases.cleaning
after = []
description = 'Deleting the EBS volume'
def run(self, info):
info.volume.delete()
del info.volume