From 4e2503ad9c0d0aecd83a5153259b6c570a29ce50 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Tue, 9 Jul 2013 20:32:50 +0200 Subject: [PATCH] Put task class properties in identical order --- plugins/prebootstrapped/tasks.py | 3 +-- providers/ec2/tasks/ebs.py | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/plugins/prebootstrapped/tasks.py b/plugins/prebootstrapped/tasks.py index 91aa258..ccaeed8 100644 --- a/plugins/prebootstrapped/tasks.py +++ b/plugins/prebootstrapped/tasks.py @@ -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'] diff --git a/providers/ec2/tasks/ebs.py b/providers/ec2/tasks/ebs.py index 226b34e..453fe29 100644 --- a/providers/ec2/tasks/ebs.py +++ b/providers/ec2/tasks/ebs.py @@ -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