mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Rollback task for prebootstrapped plugin
This commit is contained in:
parent
6dfdc2ed6d
commit
0c1677eef2
1 changed files with 12 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
|
from tasks import CreateVolumeFromSnapshot
|
||||||
|
from providers.ec2.tasks import ebs
|
||||||
|
|
||||||
|
|
||||||
def tasks(tasklist, manifest):
|
def tasks(tasklist, manifest):
|
||||||
from tasks import CreateVolumeFromSnapshot
|
|
||||||
from providers.ec2.tasks import ebs
|
|
||||||
from providers.ec2.tasks import bootstrap
|
from providers.ec2.tasks import bootstrap
|
||||||
from providers.ec2.tasks import filesystem
|
from providers.ec2.tasks import filesystem
|
||||||
tasklist.replace(ebs.CreateVolume, CreateVolumeFromSnapshot())
|
tasklist.replace(ebs.CreateVolume, CreateVolumeFromSnapshot())
|
||||||
|
@ -11,3 +11,13 @@ def tasks(tasklist, manifest):
|
||||||
filesystem.AddXFSProgs,
|
filesystem.AddXFSProgs,
|
||||||
bootstrap.MakeTarball,
|
bootstrap.MakeTarball,
|
||||||
bootstrap.Bootstrap)
|
bootstrap.Bootstrap)
|
||||||
|
|
||||||
|
|
||||||
|
def rollback_tasks(tasklist, tasks_completed, manifest):
|
||||||
|
completed = [type(task) for task in tasks_completed]
|
||||||
|
|
||||||
|
def counter_task(task, counter):
|
||||||
|
if task in completed and counter not in completed:
|
||||||
|
tasklist.add(counter())
|
||||||
|
|
||||||
|
counter_task(ebs.CreateVolumeFromSnapshot, ebs.DeleteVolume)
|
||||||
|
|
Loading…
Add table
Reference in a new issue