2013-09-15 13:19:45 +02:00
|
|
|
from base import Task
|
|
|
|
from common import phases
|
2013-09-15 16:59:56 +02:00
|
|
|
from common.tasks import workspace
|
2013-09-15 13:19:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2013-09-15 16:59:56 +02:00
|
|
|
before = [workspace.DeleteWorkspace]
|
2013-09-15 13:19:45 +02:00
|
|
|
|
|
|
|
def run(self, info):
|
|
|
|
info.volume.delete()
|