mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Reorganize imports a little
This commit is contained in:
parent
2b5664b0b2
commit
98d4a074b1
3 changed files with 61 additions and 61 deletions
|
@ -1,5 +1,5 @@
|
||||||
__all__ = ['Manifest', 'Phase', 'Task', 'main']
|
__all__ = ['Manifest', 'Phase', 'Task', 'main']
|
||||||
from manifest import Manifest
|
from manifest import Manifest
|
||||||
from task import Task
|
|
||||||
from phase import Phase
|
from phase import Phase
|
||||||
|
from task import Task
|
||||||
from main import main
|
from main import main
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
from manifest import Manifest
|
from manifest import Manifest
|
||||||
import logging
|
import tasks.packages
|
||||||
from tasks import packages
|
import tasks.connection
|
||||||
from tasks import connection
|
import tasks.host
|
||||||
from tasks import host
|
import tasks.ami
|
||||||
from tasks import ami
|
import tasks.ebs
|
||||||
from common.tasks import volume as volume_tasks
|
import tasks.filesystem
|
||||||
from tasks import ebs
|
import tasks.boot
|
||||||
|
import tasks.network
|
||||||
|
import tasks.initd
|
||||||
|
from common.tasks import volume
|
||||||
|
from common.tasks import filesystem
|
||||||
|
from common.tasks import boot
|
||||||
|
from common.tasks import network
|
||||||
|
from common.tasks import initd
|
||||||
from common.tasks import partitioning
|
from common.tasks import partitioning
|
||||||
from common.tasks import loopback
|
from common.tasks import loopback
|
||||||
from common.tasks import filesystem as common_filesystem
|
|
||||||
from tasks import filesystem
|
|
||||||
from common.tasks import bootstrap
|
from common.tasks import bootstrap
|
||||||
from tasks import boot
|
|
||||||
from common.tasks import boot as common_boot
|
|
||||||
from common.tasks import security
|
from common.tasks import security
|
||||||
from tasks import network
|
|
||||||
from common.tasks import network as common_network
|
|
||||||
from tasks import initd
|
|
||||||
from common.tasks import initd as common_initd
|
|
||||||
from common.tasks import cleanup
|
from common.tasks import cleanup
|
||||||
from common.tasks import workspace
|
from common.tasks import workspace
|
||||||
|
|
||||||
|
|
||||||
def initialize():
|
def initialize():
|
||||||
# Regardless of of loglevel, we don't want boto debug stuff, it's very noisy
|
# Regardless of of loglevel, we don't want boto debug stuff, it's very noisy
|
||||||
|
import logging
|
||||||
logging.getLogger('boto').setLevel(logging.INFO)
|
logging.getLogger('boto').setLevel(logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,49 +43,49 @@ def resolve_tasks(tasklist, manifest):
|
||||||
from common.task_sets import partitioning_set
|
from common.task_sets import partitioning_set
|
||||||
tasklist.add(*partitioning_set)
|
tasklist.add(*partitioning_set)
|
||||||
|
|
||||||
tasklist.add(host.HostDependencies,
|
tasklist.add(tasks.host.HostDependencies,
|
||||||
packages.DefaultPackages,
|
tasks.packages.DefaultPackages,
|
||||||
connection.GetCredentials,
|
tasks.connection.GetCredentials,
|
||||||
host.GetInfo,
|
tasks.host.GetInfo,
|
||||||
ami.AMIName,
|
tasks.ami.AMIName,
|
||||||
connection.Connect,
|
tasks.connection.Connect,
|
||||||
|
|
||||||
common_boot.BlackListModules,
|
boot.BlackListModules,
|
||||||
common_boot.DisableGetTTYs,
|
boot.DisableGetTTYs,
|
||||||
security.EnableShadowConfig,
|
security.EnableShadowConfig,
|
||||||
common_network.RemoveDNSInfo,
|
network.RemoveDNSInfo,
|
||||||
common_network.ConfigureNetworkIF,
|
network.ConfigureNetworkIF,
|
||||||
network.EnableDHCPCDDNS,
|
tasks.network.EnableDHCPCDDNS,
|
||||||
common_initd.AddExpandRoot,
|
initd.AddExpandRoot,
|
||||||
common_initd.AddSSHKeyGeneration,
|
initd.AddSSHKeyGeneration,
|
||||||
common_initd.RemoveHWClock,
|
initd.RemoveHWClock,
|
||||||
initd.AddEC2InitScripts,
|
tasks.initd.AddEC2InitScripts,
|
||||||
common_initd.InstallInitScripts,
|
initd.InstallInitScripts,
|
||||||
common_initd.AdjustExpandRootScript,
|
initd.AdjustExpandRootScript,
|
||||||
cleanup.ClearMOTD,
|
cleanup.ClearMOTD,
|
||||||
cleanup.CleanTMP,
|
cleanup.CleanTMP,
|
||||||
|
|
||||||
ami.RegisterAMI)
|
tasks.ami.RegisterAMI)
|
||||||
|
|
||||||
if manifest.virtualization == 'pvm':
|
if manifest.virtualization == 'pvm':
|
||||||
tasklist.add(boot.ConfigurePVGrub)
|
tasklist.add(tasks.boot.ConfigurePVGrub)
|
||||||
else:
|
else:
|
||||||
tasklist.add(common_boot.InstallGrub)
|
tasklist.add(boot.InstallGrub)
|
||||||
|
|
||||||
backing_specific_tasks = {'ebs': [ebs.Create,
|
backing_specific_tasks = {'ebs': [tasks.ebs.Create,
|
||||||
ebs.Attach,
|
tasks.ebs.Attach,
|
||||||
common_filesystem.FStab,
|
filesystem.FStab,
|
||||||
ebs.Snapshot],
|
tasks.ebs.Snapshot],
|
||||||
's3': [loopback.Create,
|
's3': [loopback.Create,
|
||||||
volume_tasks.Attach,
|
volume.Attach,
|
||||||
filesystem.S3FStab,
|
tasks.filesystem.S3FStab,
|
||||||
ami.BundleImage,
|
tasks.ami.BundleImage,
|
||||||
ami.UploadImage,
|
tasks.ami.UploadImage,
|
||||||
ami.RemoveBundle]}
|
tasks.ami.RemoveBundle]}
|
||||||
tasklist.add(*backing_specific_tasks.get(manifest.volume['backing'].lower()))
|
tasklist.add(*backing_specific_tasks.get(manifest.volume['backing'].lower()))
|
||||||
tasklist.add(common_filesystem.Format,
|
tasklist.add(filesystem.Format,
|
||||||
volume_tasks.Detach,
|
volume.Detach,
|
||||||
volume_tasks.Delete)
|
volume.Delete)
|
||||||
|
|
||||||
if manifest.bootstrapper.get('tarball', False):
|
if manifest.bootstrapper.get('tarball', False):
|
||||||
tasklist.add(bootstrap.MakeTarball)
|
tasklist.add(bootstrap.MakeTarball)
|
||||||
|
@ -105,16 +105,16 @@ def resolve_rollback_tasks(tasklist, tasks_completed, manifest):
|
||||||
if task in completed and counter not in completed:
|
if task in completed and counter not in completed:
|
||||||
tasklist.add(counter)
|
tasklist.add(counter)
|
||||||
|
|
||||||
counter_task(ebs.Create, volume_tasks.Delete)
|
counter_task(tasks.ebs.Create, volume.Delete)
|
||||||
counter_task(ebs.Attach, volume_tasks.Detach)
|
counter_task(tasks.ebs.Attach, volume.Detach)
|
||||||
|
|
||||||
counter_task(loopback.Create, volume_tasks.Delete)
|
counter_task(loopback.Create, volume.Delete)
|
||||||
counter_task(volume_tasks.Attach, volume_tasks.Detach)
|
counter_task(volume.Attach, volume.Detach)
|
||||||
|
|
||||||
counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions)
|
counter_task(partitioning.MapPartitions, partitioning.UnmapPartitions)
|
||||||
counter_task(common_filesystem.CreateMountDir, common_filesystem.DeleteMountDir)
|
counter_task(filesystem.CreateMountDir, filesystem.DeleteMountDir)
|
||||||
|
|
||||||
counter_task(common_filesystem.MountRoot, common_filesystem.UnmountRoot)
|
counter_task(filesystem.MountRoot, filesystem.UnmountRoot)
|
||||||
counter_task(volume_tasks.Attach, volume_tasks.Detach)
|
counter_task(volume.Attach, volume.Detach)
|
||||||
counter_task(workspace.CreateWorkspace, workspace.DeleteWorkspace)
|
counter_task(workspace.CreateWorkspace, workspace.DeleteWorkspace)
|
||||||
counter_task(ami.BundleImage, ami.RemoveBundle)
|
counter_task(tasks.ami.BundleImage, tasks.ami.RemoveBundle)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from manifest import Manifest
|
from manifest import Manifest
|
||||||
from tasks import packages
|
import tasks.packages
|
||||||
from common.tasks import volume as volume_tasks
|
from common.tasks import volume
|
||||||
from common.tasks import loopback
|
from common.tasks import loopback
|
||||||
from common.tasks import partitioning
|
from common.tasks import partitioning
|
||||||
from common.tasks import filesystem
|
from common.tasks import filesystem
|
||||||
|
@ -33,7 +33,7 @@ def resolve_tasks(tasklist, manifest):
|
||||||
from common.task_sets import partitioning_set
|
from common.task_sets import partitioning_set
|
||||||
tasklist.add(*partitioning_set)
|
tasklist.add(*partitioning_set)
|
||||||
|
|
||||||
tasklist.add(packages.DefaultPackages,
|
tasklist.add(tasks.packages.DefaultPackages,
|
||||||
|
|
||||||
loopback.Create,
|
loopback.Create,
|
||||||
|
|
||||||
|
@ -73,9 +73,9 @@ def resolve_rollback_tasks(tasklist, tasks_completed, manifest):
|
||||||
if task in completed and counter not in completed:
|
if task in completed and counter not in completed:
|
||||||
tasklist.add(counter)
|
tasklist.add(counter)
|
||||||
|
|
||||||
counter_task(loopback.Create, volume_tasks.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)
|
||||||
counter_task(filesystem.MountRoot, filesystem.UnmountRoot)
|
counter_task(filesystem.MountRoot, filesystem.UnmountRoot)
|
||||||
counter_task(volume_tasks.Attach, volume_tasks.Detach)
|
counter_task(volume.Attach, volume.Detach)
|
||||||
counter_task(workspace.CreateWorkspace, workspace.DeleteWorkspace)
|
counter_task(workspace.CreateWorkspace, workspace.DeleteWorkspace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue