Remove ambiguous tasklist function replace()

This commit is contained in:
Anders Ingemann 2013-10-06 14:08:53 +02:00
parent aa91bc701f
commit f075d1f2b9
2 changed files with 6 additions and 7 deletions

View file

@ -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)))

View file

@ -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)