2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from .. import phases
|
|
|
|
import workspace
|
2013-09-15 13:19:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Attach(Task):
|
|
|
|
description = 'Attaching the volume'
|
|
|
|
phase = phases.volume_creation
|
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2013-09-15 13:19:45 +02:00
|
|
|
info.volume.attach()
|
|
|
|
|
|
|
|
|
|
|
|
class Detach(Task):
|
|
|
|
description = 'Detaching the volume'
|
|
|
|
phase = phases.volume_unmounting
|
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2013-09-15 13:19:45 +02:00
|
|
|
info.volume.detach()
|
|
|
|
|
|
|
|
|
|
|
|
class Delete(Task):
|
|
|
|
description = 'Deleting the volume'
|
|
|
|
phase = phases.cleaning
|
2013-11-21 15:54:42 +01:00
|
|
|
successors = [workspace.DeleteWorkspace]
|
2013-09-15 13:19:45 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2013-09-15 13:19:45 +02:00
|
|
|
info.volume.delete()
|