mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
fix pylint W0403(relative-import)
This commit is contained in:
parent
33de3bb696
commit
6e183914ac
86 changed files with 161 additions and 161 deletions
|
@ -1,6 +1,6 @@
|
|||
from phase import Phase
|
||||
from task import Task
|
||||
from main import main
|
||||
from .phase import Phase
|
||||
from .task import Task
|
||||
from .main import main
|
||||
|
||||
__all__ = ['Phase', 'Task', 'main']
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class BootstrapInformation(object):
|
|||
self.workspace = os.path.join(manifest.bootstrapper['workspace'], self.run_id)
|
||||
|
||||
# Load all the volume information
|
||||
from fs import load_volume
|
||||
from .fs import load_volume
|
||||
self.volume = load_volume(self.manifest.volume, manifest.system['bootloader'])
|
||||
|
||||
# The default apt mirror
|
||||
|
@ -40,13 +40,13 @@ class BootstrapInformation(object):
|
|||
|
||||
# Keep a list of apt sources,
|
||||
# so that tasks may add to that list without having to fiddle with apt source list files.
|
||||
from pkg.sourceslist import SourceLists
|
||||
from .pkg.sourceslist import SourceLists
|
||||
self.source_lists = SourceLists(self.manifest_vars)
|
||||
# Keep a list of apt preferences
|
||||
from pkg.preferenceslist import PreferenceLists
|
||||
from .pkg.preferenceslist import PreferenceLists
|
||||
self.preference_lists = PreferenceLists(self.manifest_vars)
|
||||
# Keep a list of packages that should be installed, tasks can add and remove things from this list
|
||||
from pkg.packagelist import PackageList
|
||||
from .pkg.packagelist import PackageList
|
||||
self.packages = PackageList(self.manifest_vars, self.source_lists)
|
||||
|
||||
# These sets should rarely be used and specify which packages the debootstrap invocation
|
||||
|
|
|
@ -10,9 +10,9 @@ def load_volume(data, bootloader):
|
|||
:rtype: Volume
|
||||
"""
|
||||
# Map valid partition maps in the manifest and their corresponding classes
|
||||
from partitionmaps.gpt import GPTPartitionMap
|
||||
from partitionmaps.msdos import MSDOSPartitionMap
|
||||
from partitionmaps.none import NoPartitions
|
||||
from .partitionmaps.gpt import GPTPartitionMap
|
||||
from .partitionmaps.msdos import MSDOSPartitionMap
|
||||
from .partitionmaps.none import NoPartitions
|
||||
partition_map = {'none': NoPartitions,
|
||||
'gpt': GPTPartitionMap,
|
||||
'msdos': MSDOSPartitionMap,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from abstract import AbstractPartitionMap
|
||||
from .abstract import AbstractPartitionMap
|
||||
from ..partitions.gpt import GPTPartition
|
||||
from ..partitions.gpt_swap import GPTSwapPartition
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from abstract import AbstractPartitionMap
|
||||
from .abstract import AbstractPartitionMap
|
||||
from ..exceptions import PartitionError
|
||||
from ..partitions.msdos import MSDOSPartition
|
||||
from ..partitions.msdos_swap import MSDOSSwapPartition
|
||||
|
|
|
@ -117,7 +117,7 @@ class AbstractPartition(FSMProxy):
|
|||
:param list opts: Any options that should be passed to the mount command
|
||||
"""
|
||||
# Create a new mount object, mount it if the partition is mounted and put it in the mounts dict
|
||||
from mount import Mount
|
||||
from .mount import Mount
|
||||
mount = Mount(source, destination, opts)
|
||||
if self.fsm.current == 'mounted':
|
||||
mount.mount(self.mount_dir)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from abstract import AbstractPartition
|
||||
from .abstract import AbstractPartition
|
||||
from bootstrapvz.common.sectors import Sectors
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from bootstrapvz.common.tools import log_check_call
|
||||
from base import BasePartition
|
||||
from .base import BasePartition
|
||||
|
||||
|
||||
class GPTPartition(BasePartition):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from bootstrapvz.common.tools import log_check_call
|
||||
from gpt import GPTPartition
|
||||
from .gpt import GPTPartition
|
||||
|
||||
|
||||
class GPTSwapPartition(GPTPartition):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from abstract import AbstractPartition
|
||||
from .abstract import AbstractPartition
|
||||
import os.path
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from base import BasePartition
|
||||
from .base import BasePartition
|
||||
|
||||
|
||||
class MSDOSPartition(BasePartition):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from bootstrapvz.common.tools import log_check_call
|
||||
from msdos import MSDOSPartition
|
||||
from .msdos import MSDOSPartition
|
||||
|
||||
|
||||
class MSDOSSwapPartition(MSDOSPartition):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from abstract import AbstractPartition
|
||||
from .abstract import AbstractPartition
|
||||
|
||||
|
||||
class SinglePartition(AbstractPartition):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from base import BasePartition
|
||||
from .base import BasePartition
|
||||
|
||||
|
||||
class UnformattedPartition(BasePartition):
|
||||
|
|
|
@ -2,7 +2,7 @@ from abc import ABCMeta
|
|||
from bootstrapvz.common.fsm_proxy import FSMProxy
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
from .exceptions import VolumeError
|
||||
from partitionmaps.none import NoPartitions
|
||||
from .partitionmaps.none import NoPartitions
|
||||
|
||||
|
||||
class Volume(FSMProxy):
|
||||
|
|
|
@ -19,7 +19,7 @@ def main():
|
|||
setup_loggers(opts)
|
||||
|
||||
# Load the manifest
|
||||
from manifest import Manifest
|
||||
from .manifest import Manifest
|
||||
manifest = Manifest(path=opts['MANIFEST'])
|
||||
|
||||
# Everything has been set up, begin the bootstrapping process
|
||||
|
@ -62,7 +62,7 @@ def setup_loggers(opts):
|
|||
root = logging.getLogger()
|
||||
root.setLevel(logging.NOTSET)
|
||||
|
||||
import log
|
||||
from . import log
|
||||
# Log to file unless --log is a single dash
|
||||
if opts['--log'] != '-':
|
||||
import os.path
|
||||
|
@ -95,15 +95,15 @@ def run(manifest, debug=False, pause_on_error=False, dry_run=False):
|
|||
|
||||
log = logging.getLogger(__name__)
|
||||
# Get the tasklist
|
||||
from tasklist import load_tasks
|
||||
from tasklist import TaskList
|
||||
from .tasklist import load_tasks
|
||||
from .tasklist import TaskList
|
||||
log.info('Generating tasklist')
|
||||
tasks = load_tasks('resolve_tasks', manifest)
|
||||
tasklist = TaskList(tasks)
|
||||
# 'resolve_tasks' is the name of the function to call on the provider and plugins
|
||||
|
||||
# Create the bootstrap information object that'll be used throughout the bootstrapping process
|
||||
from bootstrapinfo import BootstrapInformation
|
||||
from .bootstrapinfo import BootstrapInformation
|
||||
bootstrap_info = BootstrapInformation(manifest=manifest, debug=debug)
|
||||
|
||||
try:
|
||||
|
|
|
@ -66,7 +66,7 @@ class PackageList(object):
|
|||
:raises PackageError: When a package of the same name but with a different target has already been added.
|
||||
:raises PackageError: When the specified target release could not be found.
|
||||
"""
|
||||
from exceptions import PackageError
|
||||
from .exceptions import PackageError
|
||||
name = name.format(**self.manifest_vars)
|
||||
if target is not None:
|
||||
target = target.format(**self.manifest_vars)
|
||||
|
|
|
@ -63,7 +63,7 @@ class Source(object):
|
|||
'(\s+(?P<components>.+\S))?\s*$')
|
||||
match = regexp.match(line).groupdict()
|
||||
if match is None:
|
||||
from exceptions import SourceError
|
||||
from .exceptions import SourceError
|
||||
raise SourceError('Unable to parse source line: ' + line)
|
||||
self.type = match['type']
|
||||
self.options = []
|
||||
|
|
|
@ -158,7 +158,7 @@ def get_all_tasks(loaded_modules):
|
|||
|
||||
# lambda function to check whether a class is a task (excluding the superclass Task)
|
||||
def is_task(obj):
|
||||
from task import Task
|
||||
from .task import Task
|
||||
return issubclass(obj, Task) and obj is not Task
|
||||
return filter(is_task, classes) # Only return classes that are tasks
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from exceptions import UnitError
|
||||
from .exceptions import UnitError
|
||||
|
||||
|
||||
def onlybytes(msg):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from qemuvolume import QEMUVolume
|
||||
from .qemuvolume import QEMUVolume
|
||||
|
||||
|
||||
class Qcow2Volume(QEMUVolume):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from loopbackvolume import LoopbackVolume
|
||||
from .loopbackvolume import LoopbackVolume
|
||||
from bootstrapvz.base.fs.exceptions import VolumeError
|
||||
from ..tools import log_check_call
|
||||
from . import get_partitions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from qemuvolume import QEMUVolume
|
||||
from .qemuvolume import QEMUVolume
|
||||
|
||||
|
||||
class VirtualDiskImage(QEMUVolume):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from qemuvolume import QEMUVolume
|
||||
from .qemuvolume import QEMUVolume
|
||||
from ..tools import log_check_call
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from qemuvolume import QEMUVolume
|
||||
from .qemuvolume import QEMUVolume
|
||||
|
||||
|
||||
class VirtualMachineDisk(QEMUVolume):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from exceptions import UnitError
|
||||
from bytes import Bytes
|
||||
from .exceptions import UnitError
|
||||
from .bytes import Bytes
|
||||
|
||||
|
||||
def onlysectors(msg):
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
from tasks import workspace
|
||||
from tasks import packages
|
||||
from tasks import host
|
||||
from tasks import grub
|
||||
from tasks import extlinux
|
||||
from tasks import bootstrap
|
||||
from tasks import volume
|
||||
from tasks import loopback
|
||||
from tasks import filesystem
|
||||
from tasks import partitioning
|
||||
from tasks import cleanup
|
||||
from tasks import apt
|
||||
from tasks import security
|
||||
from tasks import locale
|
||||
from tasks import network
|
||||
from tasks import initd
|
||||
from tasks import ssh
|
||||
from tasks import kernel
|
||||
from tasks import folder
|
||||
from .tasks import workspace
|
||||
from .tasks import packages
|
||||
from .tasks import host
|
||||
from .tasks import grub
|
||||
from .tasks import extlinux
|
||||
from .tasks import bootstrap
|
||||
from .tasks import volume
|
||||
from .tasks import loopback
|
||||
from .tasks import filesystem
|
||||
from .tasks import partitioning
|
||||
from .tasks import cleanup
|
||||
from .tasks import apt
|
||||
from .tasks import security
|
||||
from .tasks import locale
|
||||
from .tasks import network
|
||||
from .tasks import initd
|
||||
from .tasks import ssh
|
||||
from .tasks import kernel
|
||||
from .tasks import folder
|
||||
|
||||
|
||||
def get_standard_groups(manifest):
|
||||
|
|
|
@ -2,7 +2,7 @@ from bootstrapvz.base import Task
|
|||
from bootstrapvz.common import phases
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
import locale
|
||||
from . import locale
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from bootstrapvz.base import Task
|
||||
from .. import phases
|
||||
from ..exceptions import TaskError
|
||||
import host
|
||||
from . import host
|
||||
import logging
|
||||
import os.path
|
||||
log = logging.getLogger(__name__)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from bootstrapvz.base import Task
|
||||
from .. import phases
|
||||
from ..tools import log_check_call
|
||||
import filesystem
|
||||
import kernel
|
||||
from . import filesystem
|
||||
from . import kernel
|
||||
from bootstrapvz.base.fs import partitionmaps
|
||||
import os
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from bootstrapvz.base import Task
|
||||
from .. import phases
|
||||
from ..tools import log_check_call
|
||||
import bootstrap
|
||||
import host
|
||||
import volume
|
||||
from . import bootstrap
|
||||
from . import host
|
||||
from . import volume
|
||||
|
||||
|
||||
class AddRequiredCommands(Task):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
import volume
|
||||
import workspace
|
||||
from . import volume
|
||||
from . import workspace
|
||||
|
||||
|
||||
class Create(Task):
|
||||
|
|
|
@ -2,8 +2,8 @@ from bootstrapvz.base import Task
|
|||
from ..exceptions import TaskError
|
||||
from .. import phases
|
||||
from ..tools import log_check_call
|
||||
import filesystem
|
||||
import kernel
|
||||
from . import filesystem
|
||||
from . import kernel
|
||||
from bootstrapvz.base.fs import partitionmaps
|
||||
import os.path
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
import host
|
||||
import volume
|
||||
from . import host
|
||||
from . import volume
|
||||
|
||||
|
||||
class AddRequiredCommands(Task):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.base import Task
|
||||
from .. import phases
|
||||
import apt
|
||||
from . import apt
|
||||
from ..tools import log_check_call
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
import filesystem
|
||||
import host
|
||||
import volume
|
||||
from . import filesystem
|
||||
from . import host
|
||||
from . import volume
|
||||
|
||||
|
||||
class AddRequiredCommands(Task):
|
||||
|
|
|
@ -3,7 +3,7 @@ from .. import phases
|
|||
from ..tools import log_check_call
|
||||
import os.path
|
||||
from . import assets
|
||||
import initd
|
||||
from . import initd
|
||||
import shutil
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.base import Task
|
||||
from .. import phases
|
||||
import workspace
|
||||
from . import workspace
|
||||
|
||||
|
||||
class Attach(Task):
|
||||
|
|
|
@ -67,7 +67,7 @@ def log_call(command, stdin=None, env=None, shell=False, cwd=None):
|
|||
def sed_i(file_path, pattern, subst, expected_replacements=1):
|
||||
replacement_count = inline_replace(file_path, pattern, subst)
|
||||
if replacement_count != expected_replacements:
|
||||
from exceptions import UnexpectedNumMatchesError
|
||||
from .exceptions import UnexpectedNumMatchesError
|
||||
msg = ('There were {real} instead of {expected} matches for '
|
||||
'the expression `{exp}\' in the file `{path}\''
|
||||
.format(real=replacement_count, expected=expected_replacements,
|
||||
|
|
|
@ -5,7 +5,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import logging
|
||||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common.tasks import ssh
|
||||
|
||||
from bootstrapvz.common.releases import jessie
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.add(tasks.CheckAptProxy)
|
||||
taskset.add(tasks.SetAptProxy)
|
||||
if not manifest.plugins['apt_proxy'].get('persistent', False):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -9,7 +9,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
import bootstrapvz.providers.ec2.tasks.initd as initd_ec2
|
||||
from bootstrapvz.common.tasks import apt
|
||||
from bootstrapvz.common.tasks import initd
|
||||
|
|
|
@ -6,5 +6,5 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
from tasks import ImageExecuteCommand
|
||||
from .tasks import ImageExecuteCommand
|
||||
taskset.add(ImageExecuteCommand)
|
||||
|
|
|
@ -7,5 +7,5 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.update([tasks.DebconfSetSelections])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from bootstrapvz.common.tools import rel_path
|
||||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common.tasks import apt
|
||||
from bootstrapvz.common.releases import wheezy
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.add(tasks.LaunchEC2Instance)
|
||||
if 'print_public_ip' in manifest.plugins['ec2_launch']:
|
||||
taskset.add(tasks.PrintPublicIPAddress)
|
||||
|
|
|
@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.add(tasks.CopyAmiToRegions)
|
||||
if 'manifest_url' in manifest.plugins['ec2_publish']:
|
||||
taskset.add(tasks.PublishAmiManifest)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import tasks.mounts
|
||||
import tasks.shrink
|
||||
import tasks.apt
|
||||
import tasks.dpkg
|
||||
from bootstrapvz.common.tasks import dpkg, locale
|
||||
from . import tasks.mounts
|
||||
from . import tasks.shrink
|
||||
from . import tasks.apt
|
||||
from . import tasks.dpkg
|
||||
from bootstrapvz.common.tasks import locale
|
||||
|
||||
|
||||
def get_shrink_type(plugins):
|
||||
|
|
|
@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.add(tasks.AddNtpPackage)
|
||||
if manifest.plugins['ntp'].get('servers', False):
|
||||
taskset.add(tasks.SetNtpServers)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common.tasks import apt
|
||||
from bootstrapvz.common.releases import wheezy
|
||||
if manifest.release == wheezy:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.providers.ec2.tasks import ebs
|
||||
from bootstrapvz.plugins.minimize_size.tasks import dpkg
|
||||
from bootstrapvz.providers.virtualbox.tasks import guest_additions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -7,7 +7,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
from bootstrapvz.common.tasks import ssh
|
||||
from tasks import SetRootPassword
|
||||
from .tasks import SetRootPassword
|
||||
taskset.discard(ssh.DisableSSHPasswordAuthentication)
|
||||
taskset.add(ssh.EnableRootLogin)
|
||||
taskset.add(SetRootPassword)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from bootstrapvz.common.tasks.workspace import CreateWorkspace, DeleteWorkspace
|
||||
from tasks import CreateTmpFsWorkspace, MountTmpFsWorkspace, UnmountTmpFsWorkspace, DeleteTmpFsWorkspace
|
||||
from .tasks import CreateTmpFsWorkspace, MountTmpFsWorkspace, UnmountTmpFsWorkspace, DeleteTmpFsWorkspace
|
||||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
|
|
|
@ -6,6 +6,6 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
import tasks
|
||||
from . import tasks
|
||||
taskset.add(tasks.AddUnattendedUpgradesPackage)
|
||||
taskset.add(tasks.EnablePeriodicUpgrades)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tasks
|
||||
from . import tasks
|
||||
from bootstrapvz.common import task_groups
|
||||
from bootstrapvz.common.tasks import image, ssh, volume
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
import tasks.packages
|
||||
import tasks.boot
|
||||
from . import tasks.packages
|
||||
from . import tasks.boot
|
||||
from bootstrapvz.common.tasks import image
|
||||
from bootstrapvz.common.tasks import loopback
|
||||
from bootstrapvz.common.tasks import initd
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
from bootstrapvz.common.tasks import apt, dpkg, folder, filesystem
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
import tasks.commands
|
||||
import tasks.image
|
||||
import tasks.settings
|
||||
from . import tasks.commands
|
||||
from . import tasks.image
|
||||
from . import tasks.settings
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
import tasks.packages
|
||||
import tasks.connection
|
||||
import tasks.host
|
||||
import tasks.ami
|
||||
import tasks.ebs
|
||||
import tasks.filesystem
|
||||
import tasks.boot
|
||||
import tasks.network
|
||||
import tasks.initd
|
||||
import tasks.tuning
|
||||
from . import tasks.packages
|
||||
from . import tasks.connection
|
||||
from . import tasks.host
|
||||
from . import tasks.ami
|
||||
from . import tasks.ebs
|
||||
from . import tasks.filesystem
|
||||
from . import tasks.boot
|
||||
from . import tasks.network
|
||||
from . import tasks.initd
|
||||
from . import tasks.tuning
|
||||
from bootstrapvz.common.tasks import apt, boot, filesystem, grub, initd
|
||||
from bootstrapvz.common.tasks import kernel, loopback, volume
|
||||
from bootstrapvz.common.tools import rel_path
|
||||
|
|
|
@ -2,9 +2,9 @@ from bootstrapvz.base import Task
|
|||
from bootstrapvz.common import phases
|
||||
from bootstrapvz.common.exceptions import TaskError
|
||||
from bootstrapvz.common.tools import log_check_call, rel_path
|
||||
from ebs import Snapshot
|
||||
from .ebs import Snapshot
|
||||
from bootstrapvz.common.tasks import workspace
|
||||
import connection
|
||||
from . import connection
|
||||
from . import assets
|
||||
import os.path
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
import host
|
||||
from . import host
|
||||
|
||||
|
||||
class SilenceBotoDebug(Task):
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
import tasks.apt
|
||||
import tasks.boot
|
||||
import tasks.configuration
|
||||
import tasks.image
|
||||
import tasks.packages
|
||||
from . import tasks.apt
|
||||
from . import tasks.boot
|
||||
from . import tasks.configuration
|
||||
from . import tasks.image
|
||||
from . import tasks.packages
|
||||
from bootstrapvz.common.tasks import apt, boot, image, loopback, initd
|
||||
from bootstrapvz.common.tasks import ssh, volume, grub
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
import tasks.packages
|
||||
import tasks.boot
|
||||
from . import tasks.packages
|
||||
from . import tasks.boot
|
||||
from bootstrapvz.common.tasks import image, loopback, initd, ssh, logicalvolume
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ def resolve_tasks(taskset, manifest):
|
|||
])
|
||||
|
||||
if manifest.provider.get('virtio', []):
|
||||
from tasks import virtio
|
||||
from .tasks import virtio
|
||||
taskset.update([virtio.VirtIO])
|
||||
|
||||
if manifest.provider.get('console', False):
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
from bootstrapvz.common.tasks import image, loopback, ssh, volume
|
||||
import tasks.api
|
||||
import tasks.image
|
||||
import tasks.network
|
||||
import tasks.packages
|
||||
from . import tasks.api
|
||||
from . import tasks.image
|
||||
from . import tasks.network
|
||||
from . import tasks.packages
|
||||
|
||||
|
||||
def validate_manifest(data, validator, error):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from bootstrapvz.common import task_groups
|
||||
import tasks.packages
|
||||
import tasks.boot
|
||||
from . import tasks.packages
|
||||
from . import tasks.boot
|
||||
from bootstrapvz.common.tasks import image
|
||||
from bootstrapvz.common.tasks import loopback
|
||||
|
||||
|
@ -21,7 +21,7 @@ def resolve_tasks(taskset, manifest):
|
|||
])
|
||||
|
||||
if manifest.provider.get('guest_additions', False):
|
||||
from tasks import guest_additions
|
||||
from .tasks import guest_additions
|
||||
taskset.update([guest_additions.CheckGuestAdditionsPath,
|
||||
guest_additions.AddGuestAdditionsPackages,
|
||||
guest_additions.InstallGuestAdditions,
|
||||
|
|
|
@ -26,10 +26,10 @@ def pick_build_server(build_servers, manifest, preferences={}):
|
|||
if not matches(name, settings):
|
||||
continue
|
||||
if settings['type'] == 'local':
|
||||
from local import LocalBuildServer
|
||||
from .local import LocalBuildServer
|
||||
return LocalBuildServer(name, settings)
|
||||
else:
|
||||
from remote import RemoteBuildServer
|
||||
from .remote import RemoteBuildServer
|
||||
return RemoteBuildServer(name, settings)
|
||||
raise Exception('Unable to find a build server that matches your preferences.')
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from build_server import BuildServer
|
||||
from .build_server import BuildServer
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from build_server import BuildServer
|
||||
from .build_server import BuildServer
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
from contextlib import contextmanager
|
||||
import logging
|
||||
|
@ -21,7 +21,7 @@ class RemoteBuildServer(BuildServer):
|
|||
with self.spawn_server() as forwards:
|
||||
args = {'listen_port': forwards['local_callback_port'],
|
||||
'remote_port': forwards['remote_callback_port']}
|
||||
from callback import CallbackServer
|
||||
from .callback import CallbackServer
|
||||
with CallbackServer(**args) as callback_server:
|
||||
with connect_pyro('localhost', forwards['local_server_port']) as connection:
|
||||
connection.set_callback_server(callback_server)
|
||||
|
|
|
@ -15,7 +15,7 @@ def main():
|
|||
# load the build servers file
|
||||
build_servers = load_data(opts['--servers'])
|
||||
# Pick a build server
|
||||
from build_servers import pick_build_server
|
||||
from .build_servers import pick_build_server
|
||||
preferences = {}
|
||||
if opts['--name'] is not None:
|
||||
preferences['name'] = opts['--name']
|
||||
|
|
|
@ -18,7 +18,7 @@ def setup_logging():
|
|||
root = logging.getLogger()
|
||||
root.setLevel(logging.NOTSET)
|
||||
|
||||
from log import LogForwarder
|
||||
from .log import LogForwarder
|
||||
log_forwarder = LogForwarder()
|
||||
root.addHandler(log_forwarder)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from manifests import merge_manifest_data
|
||||
from tools import boot_manifest
|
||||
from .manifests import merge_manifest_data
|
||||
from .tools import boot_manifest
|
||||
|
||||
partials = {'docker': '''
|
||||
provider:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from manifests import merge_manifest_data
|
||||
from tools import boot_manifest
|
||||
from .manifests import merge_manifest_data
|
||||
from .tools import boot_manifest
|
||||
|
||||
partials = {'ebs_hvm': '''
|
||||
provider:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from manifests import merge_manifest_data
|
||||
from tools import boot_manifest
|
||||
from .manifests import merge_manifest_data
|
||||
from .tools import boot_manifest
|
||||
|
||||
partials = {'ebs_pvm': '''
|
||||
provider:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from manifests import merge_manifest_data
|
||||
from tools import boot_manifest
|
||||
from .manifests import merge_manifest_data
|
||||
from .tools import boot_manifest
|
||||
import random
|
||||
|
||||
s3_bucket_name = '{id:x}'.format(id=random.randrange(16 ** 16))
|
||||
|
|
|
@ -48,7 +48,7 @@ def boot_image(manifest, build_server, bootstrap_info):
|
|||
build_server.remote_command(['sudo', 'docker', 'rmi',
|
||||
bootstrap_info._docker['image_id']])
|
||||
|
||||
from image import Image
|
||||
from .image import Image
|
||||
with Image(image_id, docker_env) as container:
|
||||
yield container
|
||||
finally:
|
||||
|
|
|
@ -41,10 +41,10 @@ def boot_image(manifest, build_server, bootstrap_info, instance_type=None):
|
|||
aws_secret_access_key=credentials['secret-key'])
|
||||
|
||||
if manifest.volume['backing'] == 'ebs':
|
||||
from images import EBSImage
|
||||
from .images import EBSImage
|
||||
image = EBSImage(bootstrap_info._ec2['image'], ec2_connection)
|
||||
if manifest.volume['backing'] == 's3':
|
||||
from images import S3Image
|
||||
from .images import S3Image
|
||||
image = S3Image(bootstrap_info._ec2['image'], ec2_connection)
|
||||
|
||||
try:
|
||||
|
|
|
@ -21,7 +21,7 @@ def boot_image(manifest, build_server, bootstrap_info):
|
|||
finally:
|
||||
build_server.delete(bootstrap_info.volume.image_path)
|
||||
|
||||
from image import VirtualBoxImage
|
||||
from .image import VirtualBoxImage
|
||||
image = VirtualBoxImage(image_path)
|
||||
|
||||
import hashlib
|
||||
|
@ -41,7 +41,7 @@ def boot_image(manifest, build_server, bootstrap_info):
|
|||
|
||||
@contextmanager
|
||||
def run_instance(image, instance_name, manifest):
|
||||
from instance import VirtualBoxInstance
|
||||
from .instance import VirtualBoxInstance
|
||||
instance = VirtualBoxInstance(image, instance_name,
|
||||
manifest.system['architecture'], manifest.release)
|
||||
try:
|
||||
|
|
|
@ -75,7 +75,7 @@ def read_from_socket(socket_path, termination_string, timeout, read_timeout=0.5)
|
|||
raise Exception(e)
|
||||
continue_select = False
|
||||
if default_timer() - start > timeout:
|
||||
from exceptions import SocketReadTimeout
|
||||
from .exceptions import SocketReadTimeout
|
||||
msg = ('Reading from socket `{path}\' timed out after {seconds} seconds.\n'
|
||||
'Here is the output so far:\n{output}'
|
||||
.format(path=socket_path, seconds=timeout, output=output))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from manifests import merge_manifest_data
|
||||
from tools import boot_manifest
|
||||
from .manifests import merge_manifest_data
|
||||
from .tools import boot_manifest
|
||||
|
||||
partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}',
|
||||
'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}',
|
||||
|
|
Loading…
Add table
Reference in a new issue