Easier overview of tasks being added

This commit is contained in:
Anders Ingemann 2013-08-10 17:52:24 +02:00
parent 110ec638c1
commit 5dc00d920c
2 changed files with 19 additions and 12 deletions

View file

@ -65,6 +65,7 @@ def tasks(tasklist, manifest):
apt.AptClean(), apt.AptClean(),
apt.EnableDaemonAutostart(), apt.EnableDaemonAutostart(),
filesystem.UnmountSpecials(), filesystem.UnmountSpecials(),
filesystem.UnmountVolume(), filesystem.UnmountVolume(),
filesystem.DeleteMountDir(), filesystem.DeleteMountDir(),
ami.RegisterAMI()) ami.RegisterAMI())

View file

@ -22,19 +22,16 @@ def initialize():
def tasks(tasklist, manifest): def tasks(tasklist, manifest):
tasklist.add(packages.HostPackages(), tasklist.add(packages.HostPackages(),
packages.ImagePackages(), packages.ImagePackages(),
host.CheckPackages()) host.CheckPackages(),
tasklist.add(filesystem.FormatVolume())
if manifest.volume['filesystem'].lower() == 'xfs': filesystem.FormatVolume(),
tasklist.add(common_filesystem.AddXFSProgs()) common_filesystem.CreateMountDir(),
if manifest.volume['filesystem'].lower() in ['ext2', 'ext3', 'ext4']: filesystem.MountVolume(),
tasklist.add(filesystem.TuneVolumeFS())
tasklist.add(common_filesystem.CreateMountDir(), bootstrap.Bootstrap(),
filesystem.MountVolume())
if manifest.bootstrapper['tarball']:
tasklist.add(bootstrap.MakeTarball())
tasklist.add(bootstrap.Bootstrap(),
common_filesystem.MountSpecials(), common_filesystem.MountSpecials(),
locale.GenerateLocale(), locale.GenerateLocale(),
context.OpenNebulaContext(),
locale.SetTimezone(), locale.SetTimezone(),
apt.DisableDaemonAutostart(), apt.DisableDaemonAutostart(),
apt.AptSources(), apt.AptSources(),
@ -60,9 +57,18 @@ def tasks(tasklist, manifest):
apt.AptClean(), apt.AptClean(),
apt.EnableDaemonAutostart(), apt.EnableDaemonAutostart(),
common_filesystem.UnmountSpecials(), common_filesystem.UnmountSpecials(),
filesystem.UnmountVolume(), filesystem.UnmountVolume(),
common_filesystem.DeleteMountDir()) common_filesystem.DeleteMountDir())
tasklist.add(context.OpenNebulaContext())
if manifest.bootstrapper['tarball']:
tasklist.add(bootstrap.MakeTarball())
filesystem_specific_tasks = {'xfs': [filesystem.AddXFSProgs()],
'ext2': [filesystem.TuneVolumeFS()],
'ext3': [filesystem.TuneVolumeFS()],
'ext4': [filesystem.TuneVolumeFS()]}
tasklist.add(*filesystem_specific_tasks.get(manifest.volume['filesystem'].lower()))
def rollback_tasks(tasklist, tasks_completed, manifest): def rollback_tasks(tasklist, tasks_completed, manifest):