mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-11 01:29:50 +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:
|
for task in args:
|
||||||
self.tasks.discard(task)
|
self.tasks.discard(task)
|
||||||
|
|
||||||
def replace(self, task, replacement):
|
|
||||||
self.remove(task)
|
|
||||||
self.add(replacement)
|
|
||||||
|
|
||||||
def run(self, bootstrap_info):
|
def run(self, bootstrap_info):
|
||||||
task_list = self.create_list(self.tasks)
|
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)))
|
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):
|
def tasks(tasklist, manifest):
|
||||||
settings = manifest.plugins['prebootstrapped']
|
settings = manifest.plugins['prebootstrapped']
|
||||||
skip_tasks = [filesystem.Format,
|
skip_tasks = [ebs.Create,
|
||||||
|
loopback.Create,
|
||||||
|
|
||||||
|
filesystem.Format,
|
||||||
partitioning.PartitionVolume,
|
partitioning.PartitionVolume,
|
||||||
filesystem.TuneVolumeFS,
|
filesystem.TuneVolumeFS,
|
||||||
filesystem.AddXFSProgs,
|
filesystem.AddXFSProgs,
|
||||||
|
@ -22,7 +25,7 @@ def tasks(tasklist, manifest):
|
||||||
bootstrap.Bootstrap]
|
bootstrap.Bootstrap]
|
||||||
if manifest.volume['backing'] == 'ebs':
|
if manifest.volume['backing'] == 'ebs':
|
||||||
if 'snapshot' in settings and settings['snapshot'] is not None:
|
if 'snapshot' in settings and settings['snapshot'] is not None:
|
||||||
tasklist.replace(ebs.Create, CreateFromSnapshot)
|
tasklist.add(CreateFromSnapshot)
|
||||||
tasklist.remove(*skip_tasks)
|
tasklist.remove(*skip_tasks)
|
||||||
if 'boot' in manifest.volume['partitions']:
|
if 'boot' in manifest.volume['partitions']:
|
||||||
tasklist.add(SetBootMountDir)
|
tasklist.add(SetBootMountDir)
|
||||||
|
@ -30,7 +33,7 @@ def tasks(tasklist, manifest):
|
||||||
tasklist.add(Snapshot)
|
tasklist.add(Snapshot)
|
||||||
else:
|
else:
|
||||||
if 'image' in settings and settings['image'] is not None:
|
if 'image' in settings and settings['image'] is not None:
|
||||||
tasklist.replace(loopback.Create, CreateFromImage)
|
tasklist.add(CreateFromImage)
|
||||||
tasklist.remove(*skip_tasks)
|
tasklist.remove(*skip_tasks)
|
||||||
if 'boot' in manifest.volume['partitions']:
|
if 'boot' in manifest.volume['partitions']:
|
||||||
tasklist.add(SetBootMountDir)
|
tasklist.add(SetBootMountDir)
|
||||||
|
|
Loading…
Add table
Reference in a new issue