mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-10 17:19:51 +00:00
Remove ambiguous tasklist function replace()
This commit is contained in:
parent
aa91bc701f
commit
f075d1f2b9
2 changed files with 6 additions and 7 deletions
|
@ -16,10 +16,6 @@ class TaskList(object):
|
|||
for task in args:
|
||||
self.tasks.discard(task)
|
||||
|
||||
def replace(self, task, replacement):
|
||||
self.remove(task)
|
||||
self.add(replacement)
|
||||
|
||||
def run(self, bootstrap_info):
|
||||
task_list = self.create_list(self.tasks)
|
||||
log.debug('Tasklist:\n\t{list}'.format(list='\n\t'.join(repr(task) for task in task_list)))
|
||||
|
|
|
@ -13,7 +13,10 @@ from common.tasks import partitioning
|
|||
|
||||
def tasks(tasklist, manifest):
|
||||
settings = manifest.plugins['prebootstrapped']
|
||||
skip_tasks = [filesystem.Format,
|
||||
skip_tasks = [ebs.Create,
|
||||
loopback.Create,
|
||||
|
||||
filesystem.Format,
|
||||
partitioning.PartitionVolume,
|
||||
filesystem.TuneVolumeFS,
|
||||
filesystem.AddXFSProgs,
|
||||
|
@ -22,7 +25,7 @@ def tasks(tasklist, manifest):
|
|||
bootstrap.Bootstrap]
|
||||
if manifest.volume['backing'] == 'ebs':
|
||||
if 'snapshot' in settings and settings['snapshot'] is not None:
|
||||
tasklist.replace(ebs.Create, CreateFromSnapshot)
|
||||
tasklist.add(CreateFromSnapshot)
|
||||
tasklist.remove(*skip_tasks)
|
||||
if 'boot' in manifest.volume['partitions']:
|
||||
tasklist.add(SetBootMountDir)
|
||||
|
@ -30,7 +33,7 @@ def tasks(tasklist, manifest):
|
|||
tasklist.add(Snapshot)
|
||||
else:
|
||||
if 'image' in settings and settings['image'] is not None:
|
||||
tasklist.replace(loopback.Create, CreateFromImage)
|
||||
tasklist.add(CreateFromImage)
|
||||
tasklist.remove(*skip_tasks)
|
||||
if 'boot' in manifest.volume['partitions']:
|
||||
tasklist.add(SetBootMountDir)
|
||||
|
|
Loading…
Add table
Reference in a new issue