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