Rename task_sets to task_groups

This closes #17
This commit is contained in:
Tiago Ilieve 2014-04-26 17:13:41 -03:00
parent 1d36255a78
commit fe6a5047cd
5 changed files with 53 additions and 53 deletions

View file

@ -26,25 +26,25 @@ def validate_manifest(data, validator, error):
error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader']) error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader'])
def resolve_tasks(tasklist, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common import task_sets from bootstrapvz.common import task_groups
tasklist.update(task_sets.base_set) taskset.update(task_groups.base_set)
tasklist.update(task_sets.volume_set) taskset.update(task_groups.volume_set)
tasklist.update(task_sets.mounting_set) taskset.update(task_groups.mounting_set)
tasklist.update(task_sets.get_apt_set(manifest)) taskset.update(task_groups.get_apt_set(manifest))
tasklist.update(task_sets.locale_set) taskset.update(task_groups.locale_set)
tasklist.update(task_sets.bootloader_set.get(manifest.system['bootloader'])) taskset.update(task_groups.bootloader_set.get(manifest.system['bootloader']))
if manifest.volume['partitions']['type'] != 'none': if manifest.volume['partitions']['type'] != 'none':
tasklist.update(task_sets.partitioning_set) taskset.update(task_groups.partitioning_set)
if manifest.system.get('hostname', False): if manifest.system.get('hostname', False):
tasklist.add(network.SetHostname) taskset.add(network.SetHostname)
else: else:
tasklist.add(network.RemoveHostname) taskset.add(network.RemoveHostname)
tasklist.update([tasks.packages.DefaultPackages, taskset.update([tasks.packages.DefaultPackages,
loopback.Create, loopback.Create,
security.EnableShadowConfig, security.EnableShadowConfig,
network.RemoveDNSInfo, network.RemoveDNSInfo,
@ -59,15 +59,15 @@ def resolve_tasks(tasklist, manifest):
]) ])
if manifest.bootstrapper.get('tarball', False): if manifest.bootstrapper.get('tarball', False):
tasklist.add(bootstrap.MakeTarball) taskset.add(bootstrap.MakeTarball)
tasklist.update(task_sets.get_fs_specific_set(manifest.volume['partitions'])) taskset.update(task_groups.get_fs_specific_set(manifest.volume['partitions']))
if 'boot' in manifest.volume['partitions']: if 'boot' in manifest.volume['partitions']:
tasklist.update(task_sets.boot_partition_set) taskset.update(task_groups.boot_partition_set)
def resolve_rollback_tasks(tasklist, manifest, counter_task): def resolve_rollback_tasks(taskset, manifest, counter_task):
counter_task(loopback.Create, volume.Delete) counter_task(loopback.Create, volume.Delete)
counter_task(filesystem.CreateMountDir, filesystem.DeleteMountDir) counter_task(filesystem.CreateMountDir, filesystem.DeleteMountDir)
counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions) counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions)

View file

@ -51,15 +51,15 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common import task_sets from bootstrapvz.common import task_groups
taskset.update(task_sets.base_set) taskset.update(task_groups.base_set)
taskset.update(task_sets.mounting_set) taskset.update(task_groups.mounting_set)
taskset.update(task_sets.get_apt_set(manifest)) taskset.update(task_groups.get_apt_set(manifest))
taskset.update(task_sets.locale_set) taskset.update(task_groups.locale_set)
taskset.update(task_sets.ssh_set) taskset.update(task_groups.ssh_set)
if manifest.volume['partitions']['type'] != 'none': if manifest.volume['partitions']['type'] != 'none':
taskset.update(task_sets.partitioning_set) taskset.update(task_groups.partitioning_set)
if manifest.system.get('hostname', False): if manifest.system.get('hostname', False):
taskset.add(network.SetHostname) taskset.add(network.SetHostname)
@ -95,7 +95,7 @@ def resolve_tasks(taskset, manifest):
taskset.add(boot.AddGrubPackage) taskset.add(boot.AddGrubPackage)
taskset.add(tasks.boot.ConfigurePVGrub) taskset.add(tasks.boot.ConfigurePVGrub)
else: else:
taskset.update(task_sets.bootloader_set.get(manifest.system['bootloader'])) taskset.update(task_groups.bootloader_set.get(manifest.system['bootloader']))
backing_specific_tasks = {'ebs': [tasks.ebs.Create, backing_specific_tasks = {'ebs': [tasks.ebs.Create,
tasks.ebs.Attach, tasks.ebs.Attach,
@ -117,10 +117,10 @@ def resolve_tasks(taskset, manifest):
if manifest.bootstrapper.get('tarball', False): if manifest.bootstrapper.get('tarball', False):
taskset.add(bootstrap.MakeTarball) taskset.add(bootstrap.MakeTarball)
taskset.update(task_sets.get_fs_specific_set(manifest.volume['partitions'])) taskset.update(task_groups.get_fs_specific_set(manifest.volume['partitions']))
if 'boot' in manifest.volume['partitions']: if 'boot' in manifest.volume['partitions']:
taskset.update(task_sets.boot_partition_set) taskset.update(task_groups.boot_partition_set)
def resolve_rollback_tasks(taskset, manifest, counter_task): def resolve_rollback_tasks(taskset, manifest, counter_task):

View file

@ -24,25 +24,25 @@ def validate_manifest(data, validator, error):
error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader']) error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader'])
def resolve_tasks(tasklist, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common import task_sets from bootstrapvz.common import task_groups
tasklist.update(task_sets.base_set) taskset.update(task_groups.base_set)
tasklist.update(task_sets.volume_set) taskset.update(task_groups.volume_set)
tasklist.update(task_sets.mounting_set) taskset.update(task_groups.mounting_set)
tasklist.update(task_sets.get_apt_set(manifest)) taskset.update(task_groups.get_apt_set(manifest))
tasklist.update(task_sets.locale_set) taskset.update(task_groups.locale_set)
tasklist.update(task_sets.bootloader_set.get(manifest.system['bootloader'])) taskset.update(task_groups.bootloader_set.get(manifest.system['bootloader']))
if manifest.volume['partitions']['type'] != 'none': if manifest.volume['partitions']['type'] != 'none':
tasklist.update(task_sets.partitioning_set) taskset.update(task_groups.partitioning_set)
if manifest.system.get('hostname', False): if manifest.system.get('hostname', False):
tasklist.add(network.SetHostname) taskset.add(network.SetHostname)
else: else:
tasklist.add(network.RemoveHostname) taskset.add(network.RemoveHostname)
tasklist.update([tasks.packages.DefaultPackages, taskset.update([tasks.packages.DefaultPackages,
loopback.Create, loopback.Create,
@ -58,19 +58,19 @@ def resolve_tasks(tasklist, manifest):
]) ])
if manifest.bootstrapper.get('tarball', False): if manifest.bootstrapper.get('tarball', False):
tasklist.add(bootstrap.MakeTarball) taskset.add(bootstrap.MakeTarball)
if manifest.bootstrapper.get('virtio', []): if manifest.bootstrapper.get('virtio', []):
from tasks import virtio from tasks import virtio
tasklist.update([virtio.VirtIO]) taskset.update([virtio.VirtIO])
tasklist.update(task_sets.get_fs_specific_set(manifest.volume['partitions'])) taskset.update(task_groups.get_fs_specific_set(manifest.volume['partitions']))
if 'boot' in manifest.volume['partitions']: if 'boot' in manifest.volume['partitions']:
tasklist.update(task_sets.boot_partition_set) taskset.update(task_groups.boot_partition_set)
def resolve_rollback_tasks(tasklist, manifest, counter_task): def resolve_rollback_tasks(taskset, manifest, counter_task):
counter_task(loopback.Create, volume.Delete) counter_task(loopback.Create, volume.Delete)
counter_task(filesystem.CreateMountDir, filesystem.DeleteMountDir) counter_task(filesystem.CreateMountDir, filesystem.DeleteMountDir)
counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions) counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions)

View file

@ -25,17 +25,17 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common import task_sets from bootstrapvz.common import task_groups
taskset.update(task_sets.base_set) taskset.update(task_groups.base_set)
taskset.update(task_sets.volume_set) taskset.update(task_groups.volume_set)
taskset.update(task_sets.mounting_set) taskset.update(task_groups.mounting_set)
taskset.update(task_sets.get_apt_set(manifest)) taskset.update(task_groups.get_apt_set(manifest))
taskset.update(task_sets.locale_set) taskset.update(task_groups.locale_set)
taskset.update(task_sets.bootloader_set.get(manifest.system['bootloader'])) taskset.update(task_groups.bootloader_set.get(manifest.system['bootloader']))
if manifest.volume['partitions']['type'] != 'none': if manifest.volume['partitions']['type'] != 'none':
taskset.update(task_sets.partitioning_set) taskset.update(task_groups.partitioning_set)
if manifest.system.get('hostname', False): if manifest.system.get('hostname', False):
taskset.add(network.SetHostname) taskset.add(network.SetHostname)
@ -67,10 +67,10 @@ def resolve_tasks(taskset, manifest):
if manifest.bootstrapper.get('tarball', False): if manifest.bootstrapper.get('tarball', False):
taskset.add(bootstrap.MakeTarball) taskset.add(bootstrap.MakeTarball)
taskset.update(task_sets.get_fs_specific_set(manifest.volume['partitions'])) taskset.update(task_groups.get_fs_specific_set(manifest.volume['partitions']))
if 'boot' in manifest.volume['partitions']: if 'boot' in manifest.volume['partitions']:
taskset.update(task_sets.boot_partition_set) taskset.update(task_groups.boot_partition_set)
def resolve_rollback_tasks(taskset, manifest, counter_task): def resolve_rollback_tasks(taskset, manifest, counter_task):