Fix TuneFS task

This commit is contained in:
Anders Ingemann 2013-10-06 01:42:32 +02:00
parent 3dab414561
commit 54791268e1
2 changed files with 15 additions and 10 deletions

View file

@ -55,8 +55,16 @@ locale_set = [locale.GenerateLocale,
locale.SetTimezone,
]
fs_specific_set = {'ext2': [filesystem.TuneVolumeFS],
'ext3': [filesystem.TuneVolumeFS],
'ext4': [filesystem.TuneVolumeFS],
'xfs': [filesystem.AddXFSProgs],
}
def get_fs_specific_set(partitions):
task_set = {'ext2': [filesystem.TuneVolumeFS],
'ext3': [filesystem.TuneVolumeFS],
'ext4': [filesystem.TuneVolumeFS],
'xfs': [filesystem.AddXFSProgs],
}
tasks = set()
if 'boot' in partitions:
tasks.update(task_set.get(partitions['boot']['filesystem'], []))
if 'root' in partitions:
tasks.update(task_set.get(partitions['root']['filesystem'], []))
return tasks

View file

@ -59,11 +59,8 @@ def tasks(tasklist, manifest):
if manifest.bootstrapper.get('tarball', False):
tasklist.add(bootstrap.MakeTarball)
from common.task_sets import fs_specific_set
for partition in manifest.volume['partitions']:
if 'filesystem' in partition:
fs_tasks = fs_specific_set.get(partition['filesystem'], [])
tasklist.add(fs_tasks)
from common.task_sets import get_fs_specific_set
tasklist.add(*get_fs_specific_set(manifest.volume['partitions']))
if 'boot' in manifest.volume['partitions']:
from common.task_sets import boot_partition_set