fix pylint W0403(relative-import)

This commit is contained in:
Carlos Meza 2018-02-12 04:17:53 +00:00
parent 33de3bb696
commit 6e183914ac
86 changed files with 161 additions and 161 deletions

View file

@ -1,6 +1,6 @@
from phase import Phase from .phase import Phase
from task import Task from .task import Task
from main import main from .main import main
__all__ = ['Phase', 'Task', 'main'] __all__ = ['Phase', 'Task', 'main']

View file

@ -25,7 +25,7 @@ class BootstrapInformation(object):
self.workspace = os.path.join(manifest.bootstrapper['workspace'], self.run_id) self.workspace = os.path.join(manifest.bootstrapper['workspace'], self.run_id)
# Load all the volume information # 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']) self.volume = load_volume(self.manifest.volume, manifest.system['bootloader'])
# The default apt mirror # The default apt mirror
@ -40,13 +40,13 @@ class BootstrapInformation(object):
# Keep a list of apt sources, # Keep a list of apt sources,
# so that tasks may add to that list without having to fiddle with apt source list files. # 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) self.source_lists = SourceLists(self.manifest_vars)
# Keep a list of apt preferences # Keep a list of apt preferences
from pkg.preferenceslist import PreferenceLists from .pkg.preferenceslist import PreferenceLists
self.preference_lists = PreferenceLists(self.manifest_vars) 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 # 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) self.packages = PackageList(self.manifest_vars, self.source_lists)
# These sets should rarely be used and specify which packages the debootstrap invocation # These sets should rarely be used and specify which packages the debootstrap invocation

View file

@ -10,9 +10,9 @@ def load_volume(data, bootloader):
:rtype: Volume :rtype: Volume
""" """
# Map valid partition maps in the manifest and their corresponding classes # Map valid partition maps in the manifest and their corresponding classes
from partitionmaps.gpt import GPTPartitionMap from .partitionmaps.gpt import GPTPartitionMap
from partitionmaps.msdos import MSDOSPartitionMap from .partitionmaps.msdos import MSDOSPartitionMap
from partitionmaps.none import NoPartitions from .partitionmaps.none import NoPartitions
partition_map = {'none': NoPartitions, partition_map = {'none': NoPartitions,
'gpt': GPTPartitionMap, 'gpt': GPTPartitionMap,
'msdos': MSDOSPartitionMap, 'msdos': MSDOSPartitionMap,

View file

@ -1,4 +1,4 @@
from abstract import AbstractPartitionMap from .abstract import AbstractPartitionMap
from ..partitions.gpt import GPTPartition from ..partitions.gpt import GPTPartition
from ..partitions.gpt_swap import GPTSwapPartition from ..partitions.gpt_swap import GPTSwapPartition
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call

View file

@ -1,4 +1,4 @@
from abstract import AbstractPartitionMap from .abstract import AbstractPartitionMap
from ..exceptions import PartitionError from ..exceptions import PartitionError
from ..partitions.msdos import MSDOSPartition from ..partitions.msdos import MSDOSPartition
from ..partitions.msdos_swap import MSDOSSwapPartition from ..partitions.msdos_swap import MSDOSSwapPartition

View file

@ -117,7 +117,7 @@ class AbstractPartition(FSMProxy):
:param list opts: Any options that should be passed to the mount command :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 # 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) mount = Mount(source, destination, opts)
if self.fsm.current == 'mounted': if self.fsm.current == 'mounted':
mount.mount(self.mount_dir) mount.mount(self.mount_dir)

View file

@ -1,5 +1,5 @@
import os import os
from abstract import AbstractPartition from .abstract import AbstractPartition
from bootstrapvz.common.sectors import Sectors from bootstrapvz.common.sectors import Sectors

View file

@ -1,5 +1,5 @@
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from base import BasePartition from .base import BasePartition
class GPTPartition(BasePartition): class GPTPartition(BasePartition):

View file

@ -1,5 +1,5 @@
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from gpt import GPTPartition from .gpt import GPTPartition
class GPTSwapPartition(GPTPartition): class GPTSwapPartition(GPTPartition):

View file

@ -1,4 +1,4 @@
from abstract import AbstractPartition from .abstract import AbstractPartition
import os.path import os.path
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call

View file

@ -1,4 +1,4 @@
from base import BasePartition from .base import BasePartition
class MSDOSPartition(BasePartition): class MSDOSPartition(BasePartition):

View file

@ -1,5 +1,5 @@
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from msdos import MSDOSPartition from .msdos import MSDOSPartition
class MSDOSSwapPartition(MSDOSPartition): class MSDOSSwapPartition(MSDOSPartition):

View file

@ -1,4 +1,4 @@
from abstract import AbstractPartition from .abstract import AbstractPartition
class SinglePartition(AbstractPartition): class SinglePartition(AbstractPartition):

View file

@ -1,4 +1,4 @@
from base import BasePartition from .base import BasePartition
class UnformattedPartition(BasePartition): class UnformattedPartition(BasePartition):

View file

@ -2,7 +2,7 @@ from abc import ABCMeta
from bootstrapvz.common.fsm_proxy import FSMProxy from bootstrapvz.common.fsm_proxy import FSMProxy
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from .exceptions import VolumeError from .exceptions import VolumeError
from partitionmaps.none import NoPartitions from .partitionmaps.none import NoPartitions
class Volume(FSMProxy): class Volume(FSMProxy):

View file

@ -19,7 +19,7 @@ def main():
setup_loggers(opts) setup_loggers(opts)
# Load the manifest # Load the manifest
from manifest import Manifest from .manifest import Manifest
manifest = Manifest(path=opts['MANIFEST']) manifest = Manifest(path=opts['MANIFEST'])
# Everything has been set up, begin the bootstrapping process # Everything has been set up, begin the bootstrapping process
@ -62,7 +62,7 @@ def setup_loggers(opts):
root = logging.getLogger() root = logging.getLogger()
root.setLevel(logging.NOTSET) root.setLevel(logging.NOTSET)
import log from . import log
# Log to file unless --log is a single dash # Log to file unless --log is a single dash
if opts['--log'] != '-': if opts['--log'] != '-':
import os.path import os.path
@ -95,15 +95,15 @@ def run(manifest, debug=False, pause_on_error=False, dry_run=False):
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
# Get the tasklist # Get the tasklist
from tasklist import load_tasks from .tasklist import load_tasks
from tasklist import TaskList from .tasklist import TaskList
log.info('Generating tasklist') log.info('Generating tasklist')
tasks = load_tasks('resolve_tasks', manifest) tasks = load_tasks('resolve_tasks', manifest)
tasklist = TaskList(tasks) tasklist = TaskList(tasks)
# 'resolve_tasks' is the name of the function to call on the provider and plugins # '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 # 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) bootstrap_info = BootstrapInformation(manifest=manifest, debug=debug)
try: try:

View file

@ -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 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. :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) name = name.format(**self.manifest_vars)
if target is not None: if target is not None:
target = target.format(**self.manifest_vars) target = target.format(**self.manifest_vars)

View file

@ -63,7 +63,7 @@ class Source(object):
'(\s+(?P<components>.+\S))?\s*$') '(\s+(?P<components>.+\S))?\s*$')
match = regexp.match(line).groupdict() match = regexp.match(line).groupdict()
if match is None: if match is None:
from exceptions import SourceError from .exceptions import SourceError
raise SourceError('Unable to parse source line: ' + line) raise SourceError('Unable to parse source line: ' + line)
self.type = match['type'] self.type = match['type']
self.options = [] self.options = []

View file

@ -158,7 +158,7 @@ def get_all_tasks(loaded_modules):
# lambda function to check whether a class is a task (excluding the superclass Task) # lambda function to check whether a class is a task (excluding the superclass Task)
def is_task(obj): def is_task(obj):
from task import Task from .task import Task
return issubclass(obj, Task) and obj is not Task return issubclass(obj, Task) and obj is not Task
return filter(is_task, classes) # Only return classes that are tasks return filter(is_task, classes) # Only return classes that are tasks

View file

@ -1,4 +1,4 @@
from exceptions import UnitError from .exceptions import UnitError
def onlybytes(msg): def onlybytes(msg):

View file

@ -1,4 +1,4 @@
from qemuvolume import QEMUVolume from .qemuvolume import QEMUVolume
class Qcow2Volume(QEMUVolume): class Qcow2Volume(QEMUVolume):

View file

@ -1,4 +1,4 @@
from loopbackvolume import LoopbackVolume from .loopbackvolume import LoopbackVolume
from bootstrapvz.base.fs.exceptions import VolumeError from bootstrapvz.base.fs.exceptions import VolumeError
from ..tools import log_check_call from ..tools import log_check_call
from . import get_partitions from . import get_partitions

View file

@ -1,4 +1,4 @@
from qemuvolume import QEMUVolume from .qemuvolume import QEMUVolume
class VirtualDiskImage(QEMUVolume): class VirtualDiskImage(QEMUVolume):

View file

@ -1,4 +1,4 @@
from qemuvolume import QEMUVolume from .qemuvolume import QEMUVolume
from ..tools import log_check_call from ..tools import log_check_call

View file

@ -1,4 +1,4 @@
from qemuvolume import QEMUVolume from .qemuvolume import QEMUVolume
class VirtualMachineDisk(QEMUVolume): class VirtualMachineDisk(QEMUVolume):

View file

@ -1,5 +1,5 @@
from exceptions import UnitError from .exceptions import UnitError
from bytes import Bytes from .bytes import Bytes
def onlysectors(msg): def onlysectors(msg):

View file

@ -1,22 +1,22 @@
from tasks import workspace from .tasks import workspace
from tasks import packages from .tasks import packages
from tasks import host from .tasks import host
from tasks import grub from .tasks import grub
from tasks import extlinux from .tasks import extlinux
from tasks import bootstrap from .tasks import bootstrap
from tasks import volume from .tasks import volume
from tasks import loopback from .tasks import loopback
from tasks import filesystem from .tasks import filesystem
from tasks import partitioning from .tasks import partitioning
from tasks import cleanup from .tasks import cleanup
from tasks import apt from .tasks import apt
from tasks import security from .tasks import security
from tasks import locale from .tasks import locale
from tasks import network from .tasks import network
from tasks import initd from .tasks import initd
from tasks import ssh from .tasks import ssh
from tasks import kernel from .tasks import kernel
from tasks import folder from .tasks import folder
def get_standard_groups(manifest): def get_standard_groups(manifest):

View file

@ -2,7 +2,7 @@ from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path
import locale from . import locale
import logging import logging
import os import os

View file

@ -1,7 +1,7 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from .. import phases from .. import phases
from ..exceptions import TaskError from ..exceptions import TaskError
import host from . import host
import logging import logging
import os.path import os.path
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -1,8 +1,8 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from .. import phases from .. import phases
from ..tools import log_check_call from ..tools import log_check_call
import filesystem from . import filesystem
import kernel from . import kernel
from bootstrapvz.base.fs import partitionmaps from bootstrapvz.base.fs import partitionmaps
import os import os

View file

@ -1,9 +1,9 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from .. import phases from .. import phases
from ..tools import log_check_call from ..tools import log_check_call
import bootstrap from . import bootstrap
import host from . import host
import volume from . import volume
class AddRequiredCommands(Task): class AddRequiredCommands(Task):

View file

@ -1,7 +1,7 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
import volume from . import volume
import workspace from . import workspace
class Create(Task): class Create(Task):

View file

@ -2,8 +2,8 @@ from bootstrapvz.base import Task
from ..exceptions import TaskError from ..exceptions import TaskError
from .. import phases from .. import phases
from ..tools import log_check_call from ..tools import log_check_call
import filesystem from . import filesystem
import kernel from . import kernel
from bootstrapvz.base.fs import partitionmaps from bootstrapvz.base.fs import partitionmaps
import os.path import os.path

View file

@ -1,7 +1,7 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
import host from . import host
import volume from . import volume
class AddRequiredCommands(Task): class AddRequiredCommands(Task):

View file

@ -1,6 +1,6 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from .. import phases from .. import phases
import apt from . import apt
from ..tools import log_check_call from ..tools import log_check_call

View file

@ -1,8 +1,8 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
import filesystem from . import filesystem
import host from . import host
import volume from . import volume
class AddRequiredCommands(Task): class AddRequiredCommands(Task):

View file

@ -3,7 +3,7 @@ from .. import phases
from ..tools import log_check_call from ..tools import log_check_call
import os.path import os.path
from . import assets from . import assets
import initd from . import initd
import shutil import shutil

View file

@ -1,6 +1,6 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from .. import phases from .. import phases
import workspace from . import workspace
class Attach(Task): class Attach(Task):

View file

@ -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): def sed_i(file_path, pattern, subst, expected_replacements=1):
replacement_count = inline_replace(file_path, pattern, subst) replacement_count = inline_replace(file_path, pattern, subst)
if replacement_count != expected_replacements: if replacement_count != expected_replacements:
from exceptions import UnexpectedNumMatchesError from .exceptions import UnexpectedNumMatchesError
msg = ('There were {real} instead of {expected} matches for ' msg = ('There were {real} instead of {expected} matches for '
'the expression `{exp}\' in the file `{path}\'' 'the expression `{exp}\' in the file `{path}\''
.format(real=replacement_count, expected=expected_replacements, .format(real=replacement_count, expected=expected_replacements,

View file

@ -5,7 +5,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import logging import logging
import tasks from . import tasks
from bootstrapvz.common.tasks import ssh from bootstrapvz.common.tasks import ssh
from bootstrapvz.common.releases import jessie from bootstrapvz.common.releases import jessie

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.add(tasks.CheckAptProxy) taskset.add(tasks.CheckAptProxy)
taskset.add(tasks.SetAptProxy) taskset.add(tasks.SetAptProxy)
if not manifest.plugins['apt_proxy'].get('persistent', False): if not manifest.plugins['apt_proxy'].get('persistent', False):

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -9,7 +9,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
import bootstrapvz.providers.ec2.tasks.initd as initd_ec2 import bootstrapvz.providers.ec2.tasks.initd as initd_ec2
from bootstrapvz.common.tasks import apt from bootstrapvz.common.tasks import apt
from bootstrapvz.common.tasks import initd from bootstrapvz.common.tasks import initd

View file

@ -6,5 +6,5 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
from tasks import ImageExecuteCommand from .tasks import ImageExecuteCommand
taskset.add(ImageExecuteCommand) taskset.add(ImageExecuteCommand)

View file

@ -7,5 +7,5 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.update([tasks.DebconfSetSelections]) taskset.update([tasks.DebconfSetSelections])

View file

@ -1,5 +1,5 @@
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path
import tasks from . import tasks
from bootstrapvz.common.tasks import apt from bootstrapvz.common.tasks import apt
from bootstrapvz.common.releases import wheezy from bootstrapvz.common.releases import wheezy

View file

@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.add(tasks.LaunchEC2Instance) taskset.add(tasks.LaunchEC2Instance)
if 'print_public_ip' in manifest.plugins['ec2_launch']: if 'print_public_ip' in manifest.plugins['ec2_launch']:
taskset.add(tasks.PrintPublicIPAddress) taskset.add(tasks.PrintPublicIPAddress)

View file

@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.add(tasks.CopyAmiToRegions) taskset.add(tasks.CopyAmiToRegions)
if 'manifest_url' in manifest.plugins['ec2_publish']: if 'manifest_url' in manifest.plugins['ec2_publish']:
taskset.add(tasks.PublishAmiManifest) taskset.add(tasks.PublishAmiManifest)

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path

View file

@ -1,8 +1,8 @@
import tasks.mounts from . import tasks.mounts
import tasks.shrink from . import tasks.shrink
import tasks.apt from . import tasks.apt
import tasks.dpkg from . import tasks.dpkg
from bootstrapvz.common.tasks import dpkg, locale from bootstrapvz.common.tasks import locale
def get_shrink_type(plugins): def get_shrink_type(plugins):

View file

@ -4,7 +4,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.add(tasks.AddNtpPackage) taskset.add(tasks.AddNtpPackage)
if manifest.plugins['ntp'].get('servers', False): if manifest.plugins['ntp'].get('servers', False):
taskset.add(tasks.SetNtpServers) taskset.add(tasks.SetNtpServers)

View file

@ -1,7 +1,7 @@
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
from bootstrapvz.common.tasks import apt from bootstrapvz.common.tasks import apt
from bootstrapvz.common.releases import wheezy from bootstrapvz.common.releases import wheezy
if manifest.release == wheezy: if manifest.release == wheezy:

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
from bootstrapvz.providers.ec2.tasks import ebs from bootstrapvz.providers.ec2.tasks import ebs
from bootstrapvz.plugins.minimize_size.tasks import dpkg from bootstrapvz.plugins.minimize_size.tasks import dpkg
from bootstrapvz.providers.virtualbox.tasks import guest_additions from bootstrapvz.providers.virtualbox.tasks import guest_additions

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -7,7 +7,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common.tasks import ssh from bootstrapvz.common.tasks import ssh
from tasks import SetRootPassword from .tasks import SetRootPassword
taskset.discard(ssh.DisableSSHPasswordAuthentication) taskset.discard(ssh.DisableSSHPasswordAuthentication)
taskset.add(ssh.EnableRootLogin) taskset.add(ssh.EnableRootLogin)
taskset.add(SetRootPassword) taskset.add(SetRootPassword)

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -1,5 +1,5 @@
from bootstrapvz.common.tasks.workspace import CreateWorkspace, DeleteWorkspace 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): def resolve_tasks(taskset, manifest):

View file

@ -6,6 +6,6 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
import tasks from . import tasks
taskset.add(tasks.AddUnattendedUpgradesPackage) taskset.add(tasks.AddUnattendedUpgradesPackage)
taskset.add(tasks.EnablePeriodicUpgrades) taskset.add(tasks.EnablePeriodicUpgrades)

View file

@ -1,4 +1,4 @@
import tasks from . import tasks
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
from bootstrapvz.common.tasks import image, ssh, volume from bootstrapvz.common.tasks import image, ssh, volume
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path

View file

@ -1,6 +1,6 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.packages from . import tasks.packages
import tasks.boot from . import tasks.boot
from bootstrapvz.common.tasks import image from bootstrapvz.common.tasks import image
from bootstrapvz.common.tasks import loopback from bootstrapvz.common.tasks import loopback
from bootstrapvz.common.tasks import initd from bootstrapvz.common.tasks import initd

View file

@ -1,9 +1,9 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
from bootstrapvz.common.tasks import apt, dpkg, folder, filesystem from bootstrapvz.common.tasks import apt, dpkg, folder, filesystem
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path
import tasks.commands from . import tasks.commands
import tasks.image from . import tasks.image
import tasks.settings from . import tasks.settings
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -1,14 +1,14 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.packages from . import tasks.packages
import tasks.connection from . import tasks.connection
import tasks.host from . import tasks.host
import tasks.ami from . import tasks.ami
import tasks.ebs from . import tasks.ebs
import tasks.filesystem from . import tasks.filesystem
import tasks.boot from . import tasks.boot
import tasks.network from . import tasks.network
import tasks.initd from . import tasks.initd
import tasks.tuning from . import tasks.tuning
from bootstrapvz.common.tasks import apt, boot, filesystem, grub, initd from bootstrapvz.common.tasks import apt, boot, filesystem, grub, initd
from bootstrapvz.common.tasks import kernel, loopback, volume from bootstrapvz.common.tasks import kernel, loopback, volume
from bootstrapvz.common.tools import rel_path from bootstrapvz.common.tools import rel_path

View file

@ -2,9 +2,9 @@ from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
from bootstrapvz.common.exceptions import TaskError from bootstrapvz.common.exceptions import TaskError
from bootstrapvz.common.tools import log_check_call, rel_path from bootstrapvz.common.tools import log_check_call, rel_path
from ebs import Snapshot from .ebs import Snapshot
from bootstrapvz.common.tasks import workspace from bootstrapvz.common.tasks import workspace
import connection from . import connection
from . import assets from . import assets
import os.path import os.path

View file

@ -1,6 +1,6 @@
from bootstrapvz.base import Task from bootstrapvz.base import Task
from bootstrapvz.common import phases from bootstrapvz.common import phases
import host from . import host
class SilenceBotoDebug(Task): class SilenceBotoDebug(Task):

View file

@ -1,9 +1,9 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.apt from . import tasks.apt
import tasks.boot from . import tasks.boot
import tasks.configuration from . import tasks.configuration
import tasks.image from . import tasks.image
import tasks.packages from . import tasks.packages
from bootstrapvz.common.tasks import apt, boot, image, loopback, initd from bootstrapvz.common.tasks import apt, boot, image, loopback, initd
from bootstrapvz.common.tasks import ssh, volume, grub from bootstrapvz.common.tasks import ssh, volume, grub

View file

@ -1,6 +1,6 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.packages from . import tasks.packages
import tasks.boot from . import tasks.boot
from bootstrapvz.common.tasks import image, loopback, initd, ssh, logicalvolume from bootstrapvz.common.tasks import image, loopback, initd, ssh, logicalvolume
@ -29,7 +29,7 @@ def resolve_tasks(taskset, manifest):
]) ])
if manifest.provider.get('virtio', []): if manifest.provider.get('virtio', []):
from tasks import virtio from .tasks import virtio
taskset.update([virtio.VirtIO]) taskset.update([virtio.VirtIO])
if manifest.provider.get('console', False): if manifest.provider.get('console', False):

View file

@ -1,9 +1,9 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
from bootstrapvz.common.tasks import image, loopback, ssh, volume from bootstrapvz.common.tasks import image, loopback, ssh, volume
import tasks.api from . import tasks.api
import tasks.image from . import tasks.image
import tasks.network from . import tasks.network
import tasks.packages from . import tasks.packages
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):

View file

@ -1,6 +1,6 @@
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.packages from . import tasks.packages
import tasks.boot from . import tasks.boot
from bootstrapvz.common.tasks import image from bootstrapvz.common.tasks import image
from bootstrapvz.common.tasks import loopback from bootstrapvz.common.tasks import loopback
@ -21,7 +21,7 @@ def resolve_tasks(taskset, manifest):
]) ])
if manifest.provider.get('guest_additions', False): if manifest.provider.get('guest_additions', False):
from tasks import guest_additions from .tasks import guest_additions
taskset.update([guest_additions.CheckGuestAdditionsPath, taskset.update([guest_additions.CheckGuestAdditionsPath,
guest_additions.AddGuestAdditionsPackages, guest_additions.AddGuestAdditionsPackages,
guest_additions.InstallGuestAdditions, guest_additions.InstallGuestAdditions,

View file

@ -26,10 +26,10 @@ def pick_build_server(build_servers, manifest, preferences={}):
if not matches(name, settings): if not matches(name, settings):
continue continue
if settings['type'] == 'local': if settings['type'] == 'local':
from local import LocalBuildServer from .local import LocalBuildServer
return LocalBuildServer(name, settings) return LocalBuildServer(name, settings)
else: else:
from remote import RemoteBuildServer from .remote import RemoteBuildServer
return RemoteBuildServer(name, settings) return RemoteBuildServer(name, settings)
raise Exception('Unable to find a build server that matches your preferences.') raise Exception('Unable to find a build server that matches your preferences.')

View file

@ -1,4 +1,4 @@
from build_server import BuildServer from .build_server import BuildServer
from contextlib import contextmanager from contextlib import contextmanager

View file

@ -1,4 +1,4 @@
from build_server import BuildServer from .build_server import BuildServer
from bootstrapvz.common.tools import log_check_call from bootstrapvz.common.tools import log_check_call
from contextlib import contextmanager from contextlib import contextmanager
import logging import logging
@ -21,7 +21,7 @@ class RemoteBuildServer(BuildServer):
with self.spawn_server() as forwards: with self.spawn_server() as forwards:
args = {'listen_port': forwards['local_callback_port'], args = {'listen_port': forwards['local_callback_port'],
'remote_port': forwards['remote_callback_port']} 'remote_port': forwards['remote_callback_port']}
from callback import CallbackServer from .callback import CallbackServer
with CallbackServer(**args) as callback_server: with CallbackServer(**args) as callback_server:
with connect_pyro('localhost', forwards['local_server_port']) as connection: with connect_pyro('localhost', forwards['local_server_port']) as connection:
connection.set_callback_server(callback_server) connection.set_callback_server(callback_server)

View file

@ -15,7 +15,7 @@ def main():
# load the build servers file # load the build servers file
build_servers = load_data(opts['--servers']) build_servers = load_data(opts['--servers'])
# Pick a build server # Pick a build server
from build_servers import pick_build_server from .build_servers import pick_build_server
preferences = {} preferences = {}
if opts['--name'] is not None: if opts['--name'] is not None:
preferences['name'] = opts['--name'] preferences['name'] = opts['--name']

View file

@ -18,7 +18,7 @@ def setup_logging():
root = logging.getLogger() root = logging.getLogger()
root.setLevel(logging.NOTSET) root.setLevel(logging.NOTSET)
from log import LogForwarder from .log import LogForwarder
log_forwarder = LogForwarder() log_forwarder = LogForwarder()
root.addHandler(log_forwarder) root.addHandler(log_forwarder)

View file

@ -1,5 +1,5 @@
from manifests import merge_manifest_data from .manifests import merge_manifest_data
from tools import boot_manifest from .tools import boot_manifest
partials = {'docker': ''' partials = {'docker': '''
provider: provider:

View file

@ -1,5 +1,5 @@
from manifests import merge_manifest_data from .manifests import merge_manifest_data
from tools import boot_manifest from .tools import boot_manifest
partials = {'ebs_hvm': ''' partials = {'ebs_hvm': '''
provider: provider:

View file

@ -1,5 +1,5 @@
from manifests import merge_manifest_data from .manifests import merge_manifest_data
from tools import boot_manifest from .tools import boot_manifest
partials = {'ebs_pvm': ''' partials = {'ebs_pvm': '''
provider: provider:

View file

@ -1,5 +1,5 @@
from manifests import merge_manifest_data from .manifests import merge_manifest_data
from tools import boot_manifest from .tools import boot_manifest
import random import random
s3_bucket_name = '{id:x}'.format(id=random.randrange(16 ** 16)) s3_bucket_name = '{id:x}'.format(id=random.randrange(16 ** 16))

View file

@ -48,7 +48,7 @@ def boot_image(manifest, build_server, bootstrap_info):
build_server.remote_command(['sudo', 'docker', 'rmi', build_server.remote_command(['sudo', 'docker', 'rmi',
bootstrap_info._docker['image_id']]) bootstrap_info._docker['image_id']])
from image import Image from .image import Image
with Image(image_id, docker_env) as container: with Image(image_id, docker_env) as container:
yield container yield container
finally: finally:

View file

@ -41,10 +41,10 @@ def boot_image(manifest, build_server, bootstrap_info, instance_type=None):
aws_secret_access_key=credentials['secret-key']) aws_secret_access_key=credentials['secret-key'])
if manifest.volume['backing'] == 'ebs': if manifest.volume['backing'] == 'ebs':
from images import EBSImage from .images import EBSImage
image = EBSImage(bootstrap_info._ec2['image'], ec2_connection) image = EBSImage(bootstrap_info._ec2['image'], ec2_connection)
if manifest.volume['backing'] == 's3': if manifest.volume['backing'] == 's3':
from images import S3Image from .images import S3Image
image = S3Image(bootstrap_info._ec2['image'], ec2_connection) image = S3Image(bootstrap_info._ec2['image'], ec2_connection)
try: try:

View file

@ -21,7 +21,7 @@ def boot_image(manifest, build_server, bootstrap_info):
finally: finally:
build_server.delete(bootstrap_info.volume.image_path) build_server.delete(bootstrap_info.volume.image_path)
from image import VirtualBoxImage from .image import VirtualBoxImage
image = VirtualBoxImage(image_path) image = VirtualBoxImage(image_path)
import hashlib import hashlib
@ -41,7 +41,7 @@ def boot_image(manifest, build_server, bootstrap_info):
@contextmanager @contextmanager
def run_instance(image, instance_name, manifest): def run_instance(image, instance_name, manifest):
from instance import VirtualBoxInstance from .instance import VirtualBoxInstance
instance = VirtualBoxInstance(image, instance_name, instance = VirtualBoxInstance(image, instance_name,
manifest.system['architecture'], manifest.release) manifest.system['architecture'], manifest.release)
try: try:

View file

@ -75,7 +75,7 @@ def read_from_socket(socket_path, termination_string, timeout, read_timeout=0.5)
raise Exception(e) raise Exception(e)
continue_select = False continue_select = False
if default_timer() - start > timeout: if default_timer() - start > timeout:
from exceptions import SocketReadTimeout from .exceptions import SocketReadTimeout
msg = ('Reading from socket `{path}\' timed out after {seconds} seconds.\n' msg = ('Reading from socket `{path}\' timed out after {seconds} seconds.\n'
'Here is the output so far:\n{output}' 'Here is the output so far:\n{output}'
.format(path=socket_path, seconds=timeout, output=output)) .format(path=socket_path, seconds=timeout, output=output))

View file

@ -1,5 +1,5 @@
from manifests import merge_manifest_data from .manifests import merge_manifest_data
from tools import boot_manifest from .tools import boot_manifest
partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}', partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}',
'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}', 'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}',