From 6e183914ac11ddc8678471e88dbc312d2efc1b4b Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Mon, 12 Feb 2018 04:17:53 +0000 Subject: [PATCH] fix pylint W0403(relative-import) --- bootstrapvz/base/__init__.py | 6 +-- bootstrapvz/base/bootstrapinfo.py | 8 ++-- bootstrapvz/base/fs/__init__.py | 6 +-- bootstrapvz/base/fs/partitionmaps/gpt.py | 2 +- bootstrapvz/base/fs/partitionmaps/msdos.py | 2 +- bootstrapvz/base/fs/partitions/abstract.py | 2 +- bootstrapvz/base/fs/partitions/base.py | 2 +- bootstrapvz/base/fs/partitions/gpt.py | 2 +- bootstrapvz/base/fs/partitions/gpt_swap.py | 2 +- bootstrapvz/base/fs/partitions/mount.py | 2 +- bootstrapvz/base/fs/partitions/msdos.py | 2 +- bootstrapvz/base/fs/partitions/msdos_swap.py | 2 +- bootstrapvz/base/fs/partitions/single.py | 2 +- bootstrapvz/base/fs/partitions/unformatted.py | 2 +- bootstrapvz/base/fs/volume.py | 2 +- bootstrapvz/base/main.py | 10 ++--- bootstrapvz/base/pkg/packagelist.py | 2 +- bootstrapvz/base/pkg/sourceslist.py | 2 +- bootstrapvz/base/tasklist.py | 2 +- bootstrapvz/common/bytes.py | 2 +- bootstrapvz/common/fs/qcow2volume.py | 2 +- bootstrapvz/common/fs/qemuvolume.py | 2 +- bootstrapvz/common/fs/virtualdiskimage.py | 2 +- bootstrapvz/common/fs/virtualharddisk.py | 2 +- bootstrapvz/common/fs/virtualmachinedisk.py | 2 +- bootstrapvz/common/sectors.py | 4 +- bootstrapvz/common/task_groups.py | 38 +++++++++---------- bootstrapvz/common/tasks/apt.py | 2 +- bootstrapvz/common/tasks/bootstrap.py | 2 +- bootstrapvz/common/tasks/extlinux.py | 4 +- bootstrapvz/common/tasks/filesystem.py | 6 +-- bootstrapvz/common/tasks/folder.py | 4 +- bootstrapvz/common/tasks/grub.py | 4 +- bootstrapvz/common/tasks/loopback.py | 4 +- bootstrapvz/common/tasks/packages.py | 2 +- bootstrapvz/common/tasks/partitioning.py | 6 +-- bootstrapvz/common/tasks/ssh.py | 2 +- bootstrapvz/common/tasks/volume.py | 2 +- bootstrapvz/common/tools.py | 2 +- bootstrapvz/plugins/admin_user/__init__.py | 2 +- bootstrapvz/plugins/ansible/__init__.py | 2 +- bootstrapvz/plugins/apt_proxy/__init__.py | 2 +- bootstrapvz/plugins/chef/__init__.py | 2 +- bootstrapvz/plugins/cloud_init/__init__.py | 2 +- bootstrapvz/plugins/commands/__init__.py | 2 +- bootstrapvz/plugins/debconf/__init__.py | 2 +- bootstrapvz/plugins/docker_daemon/__init__.py | 2 +- bootstrapvz/plugins/ec2_launch/__init__.py | 2 +- bootstrapvz/plugins/ec2_publish/__init__.py | 2 +- bootstrapvz/plugins/expand_root/__init__.py | 2 +- bootstrapvz/plugins/file_copy/__init__.py | 2 +- .../plugins/google_cloud_repo/__init__.py | 2 +- bootstrapvz/plugins/minimize_size/__init__.py | 10 ++--- bootstrapvz/plugins/ntp/__init__.py | 2 +- bootstrapvz/plugins/opennebula/__init__.py | 2 +- bootstrapvz/plugins/pip_install/__init__.py | 2 +- .../plugins/prebootstrapped/__init__.py | 2 +- bootstrapvz/plugins/puppet/__init__.py | 2 +- bootstrapvz/plugins/root_password/__init__.py | 2 +- bootstrapvz/plugins/salt/__init__.py | 2 +- .../plugins/tmpfs_workspace/__init__.py | 2 +- .../plugins/unattended_upgrades/__init__.py | 2 +- bootstrapvz/plugins/vagrant/__init__.py | 2 +- bootstrapvz/providers/azure/__init__.py | 4 +- bootstrapvz/providers/docker/__init__.py | 6 +-- bootstrapvz/providers/ec2/__init__.py | 20 +++++----- bootstrapvz/providers/ec2/tasks/ami.py | 4 +- bootstrapvz/providers/ec2/tasks/connection.py | 2 +- bootstrapvz/providers/gce/__init__.py | 10 ++--- bootstrapvz/providers/kvm/__init__.py | 6 +-- bootstrapvz/providers/oracle/__init__.py | 8 ++-- bootstrapvz/providers/virtualbox/__init__.py | 6 +-- bootstrapvz/remote/build_servers/__init__.py | 4 +- bootstrapvz/remote/build_servers/local.py | 2 +- bootstrapvz/remote/build_servers/remote.py | 4 +- bootstrapvz/remote/main.py | 2 +- bootstrapvz/remote/server.py | 2 +- tests/system/docker_tests.py | 4 +- tests/system/ec2_ebs_hvm_tests.py | 4 +- tests/system/ec2_ebs_pvm_tests.py | 4 +- tests/system/ec2_s3_pvm_tests.py | 4 +- tests/system/providers/docker/__init__.py | 2 +- tests/system/providers/ec2/__init__.py | 4 +- tests/system/providers/virtualbox/__init__.py | 4 +- tests/system/tools/__init__.py | 2 +- tests/system/virtualbox_tests.py | 4 +- 86 files changed, 161 insertions(+), 161 deletions(-) diff --git a/bootstrapvz/base/__init__.py b/bootstrapvz/base/__init__.py index f6edf24..7a133d9 100644 --- a/bootstrapvz/base/__init__.py +++ b/bootstrapvz/base/__init__.py @@ -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'] diff --git a/bootstrapvz/base/bootstrapinfo.py b/bootstrapvz/base/bootstrapinfo.py index fbb7f24..ae64710 100644 --- a/bootstrapvz/base/bootstrapinfo.py +++ b/bootstrapvz/base/bootstrapinfo.py @@ -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 diff --git a/bootstrapvz/base/fs/__init__.py b/bootstrapvz/base/fs/__init__.py index baccf9f..d1537f9 100644 --- a/bootstrapvz/base/fs/__init__.py +++ b/bootstrapvz/base/fs/__init__.py @@ -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, diff --git a/bootstrapvz/base/fs/partitionmaps/gpt.py b/bootstrapvz/base/fs/partitionmaps/gpt.py index 89f5f9f..c296306 100644 --- a/bootstrapvz/base/fs/partitionmaps/gpt.py +++ b/bootstrapvz/base/fs/partitionmaps/gpt.py @@ -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 diff --git a/bootstrapvz/base/fs/partitionmaps/msdos.py b/bootstrapvz/base/fs/partitionmaps/msdos.py index 2e80d92..eb389f6 100644 --- a/bootstrapvz/base/fs/partitionmaps/msdos.py +++ b/bootstrapvz/base/fs/partitionmaps/msdos.py @@ -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 diff --git a/bootstrapvz/base/fs/partitions/abstract.py b/bootstrapvz/base/fs/partitions/abstract.py index cbbad80..f54dbac 100644 --- a/bootstrapvz/base/fs/partitions/abstract.py +++ b/bootstrapvz/base/fs/partitions/abstract.py @@ -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) diff --git a/bootstrapvz/base/fs/partitions/base.py b/bootstrapvz/base/fs/partitions/base.py index 76c8f3b..849dc20 100644 --- a/bootstrapvz/base/fs/partitions/base.py +++ b/bootstrapvz/base/fs/partitions/base.py @@ -1,5 +1,5 @@ import os -from abstract import AbstractPartition +from .abstract import AbstractPartition from bootstrapvz.common.sectors import Sectors diff --git a/bootstrapvz/base/fs/partitions/gpt.py b/bootstrapvz/base/fs/partitions/gpt.py index aa77b8a..f3a39e8 100644 --- a/bootstrapvz/base/fs/partitions/gpt.py +++ b/bootstrapvz/base/fs/partitions/gpt.py @@ -1,5 +1,5 @@ from bootstrapvz.common.tools import log_check_call -from base import BasePartition +from .base import BasePartition class GPTPartition(BasePartition): diff --git a/bootstrapvz/base/fs/partitions/gpt_swap.py b/bootstrapvz/base/fs/partitions/gpt_swap.py index c7f7c28..ef73978 100644 --- a/bootstrapvz/base/fs/partitions/gpt_swap.py +++ b/bootstrapvz/base/fs/partitions/gpt_swap.py @@ -1,5 +1,5 @@ from bootstrapvz.common.tools import log_check_call -from gpt import GPTPartition +from .gpt import GPTPartition class GPTSwapPartition(GPTPartition): diff --git a/bootstrapvz/base/fs/partitions/mount.py b/bootstrapvz/base/fs/partitions/mount.py index 5055e96..0566d5e 100644 --- a/bootstrapvz/base/fs/partitions/mount.py +++ b/bootstrapvz/base/fs/partitions/mount.py @@ -1,4 +1,4 @@ -from abstract import AbstractPartition +from .abstract import AbstractPartition import os.path from bootstrapvz.common.tools import log_check_call diff --git a/bootstrapvz/base/fs/partitions/msdos.py b/bootstrapvz/base/fs/partitions/msdos.py index 90c0bf9..fa5ae64 100644 --- a/bootstrapvz/base/fs/partitions/msdos.py +++ b/bootstrapvz/base/fs/partitions/msdos.py @@ -1,4 +1,4 @@ -from base import BasePartition +from .base import BasePartition class MSDOSPartition(BasePartition): diff --git a/bootstrapvz/base/fs/partitions/msdos_swap.py b/bootstrapvz/base/fs/partitions/msdos_swap.py index 48afcfc..49ebab8 100644 --- a/bootstrapvz/base/fs/partitions/msdos_swap.py +++ b/bootstrapvz/base/fs/partitions/msdos_swap.py @@ -1,5 +1,5 @@ from bootstrapvz.common.tools import log_check_call -from msdos import MSDOSPartition +from .msdos import MSDOSPartition class MSDOSSwapPartition(MSDOSPartition): diff --git a/bootstrapvz/base/fs/partitions/single.py b/bootstrapvz/base/fs/partitions/single.py index dfe0c2c..f4019ab 100644 --- a/bootstrapvz/base/fs/partitions/single.py +++ b/bootstrapvz/base/fs/partitions/single.py @@ -1,4 +1,4 @@ -from abstract import AbstractPartition +from .abstract import AbstractPartition class SinglePartition(AbstractPartition): diff --git a/bootstrapvz/base/fs/partitions/unformatted.py b/bootstrapvz/base/fs/partitions/unformatted.py index b71be91..556c4eb 100644 --- a/bootstrapvz/base/fs/partitions/unformatted.py +++ b/bootstrapvz/base/fs/partitions/unformatted.py @@ -1,4 +1,4 @@ -from base import BasePartition +from .base import BasePartition class UnformattedPartition(BasePartition): diff --git a/bootstrapvz/base/fs/volume.py b/bootstrapvz/base/fs/volume.py index a9e4cd8..d2f2013 100644 --- a/bootstrapvz/base/fs/volume.py +++ b/bootstrapvz/base/fs/volume.py @@ -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): diff --git a/bootstrapvz/base/main.py b/bootstrapvz/base/main.py index 7223ccd..ae3b7c4 100644 --- a/bootstrapvz/base/main.py +++ b/bootstrapvz/base/main.py @@ -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: diff --git a/bootstrapvz/base/pkg/packagelist.py b/bootstrapvz/base/pkg/packagelist.py index 3a45d85..bd50e2b 100644 --- a/bootstrapvz/base/pkg/packagelist.py +++ b/bootstrapvz/base/pkg/packagelist.py @@ -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) diff --git a/bootstrapvz/base/pkg/sourceslist.py b/bootstrapvz/base/pkg/sourceslist.py index 2a68f19..76c9daa 100644 --- a/bootstrapvz/base/pkg/sourceslist.py +++ b/bootstrapvz/base/pkg/sourceslist.py @@ -63,7 +63,7 @@ class Source(object): '(\s+(?P.+\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 = [] diff --git a/bootstrapvz/base/tasklist.py b/bootstrapvz/base/tasklist.py index f604b91..ed1c74e 100644 --- a/bootstrapvz/base/tasklist.py +++ b/bootstrapvz/base/tasklist.py @@ -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 diff --git a/bootstrapvz/common/bytes.py b/bootstrapvz/common/bytes.py index 7fab450..2ec7b91 100644 --- a/bootstrapvz/common/bytes.py +++ b/bootstrapvz/common/bytes.py @@ -1,4 +1,4 @@ -from exceptions import UnitError +from .exceptions import UnitError def onlybytes(msg): diff --git a/bootstrapvz/common/fs/qcow2volume.py b/bootstrapvz/common/fs/qcow2volume.py index e9e623f..dfaf95f 100644 --- a/bootstrapvz/common/fs/qcow2volume.py +++ b/bootstrapvz/common/fs/qcow2volume.py @@ -1,4 +1,4 @@ -from qemuvolume import QEMUVolume +from .qemuvolume import QEMUVolume class Qcow2Volume(QEMUVolume): diff --git a/bootstrapvz/common/fs/qemuvolume.py b/bootstrapvz/common/fs/qemuvolume.py index e04094f..b8c09d7 100644 --- a/bootstrapvz/common/fs/qemuvolume.py +++ b/bootstrapvz/common/fs/qemuvolume.py @@ -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 diff --git a/bootstrapvz/common/fs/virtualdiskimage.py b/bootstrapvz/common/fs/virtualdiskimage.py index 057ccf3..9e65cdf 100644 --- a/bootstrapvz/common/fs/virtualdiskimage.py +++ b/bootstrapvz/common/fs/virtualdiskimage.py @@ -1,4 +1,4 @@ -from qemuvolume import QEMUVolume +from .qemuvolume import QEMUVolume class VirtualDiskImage(QEMUVolume): diff --git a/bootstrapvz/common/fs/virtualharddisk.py b/bootstrapvz/common/fs/virtualharddisk.py index 617f7a6..1c0ea41 100644 --- a/bootstrapvz/common/fs/virtualharddisk.py +++ b/bootstrapvz/common/fs/virtualharddisk.py @@ -1,4 +1,4 @@ -from qemuvolume import QEMUVolume +from .qemuvolume import QEMUVolume from ..tools import log_check_call diff --git a/bootstrapvz/common/fs/virtualmachinedisk.py b/bootstrapvz/common/fs/virtualmachinedisk.py index 73f39be..7cffc0d 100644 --- a/bootstrapvz/common/fs/virtualmachinedisk.py +++ b/bootstrapvz/common/fs/virtualmachinedisk.py @@ -1,4 +1,4 @@ -from qemuvolume import QEMUVolume +from .qemuvolume import QEMUVolume class VirtualMachineDisk(QEMUVolume): diff --git a/bootstrapvz/common/sectors.py b/bootstrapvz/common/sectors.py index 37a828e..5298e0b 100644 --- a/bootstrapvz/common/sectors.py +++ b/bootstrapvz/common/sectors.py @@ -1,5 +1,5 @@ -from exceptions import UnitError -from bytes import Bytes +from .exceptions import UnitError +from .bytes import Bytes def onlysectors(msg): diff --git a/bootstrapvz/common/task_groups.py b/bootstrapvz/common/task_groups.py index 7882e15..21c0a27 100644 --- a/bootstrapvz/common/task_groups.py +++ b/bootstrapvz/common/task_groups.py @@ -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): diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 6367e81..0817b83 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -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 diff --git a/bootstrapvz/common/tasks/bootstrap.py b/bootstrapvz/common/tasks/bootstrap.py index 436450e..4f45781 100644 --- a/bootstrapvz/common/tasks/bootstrap.py +++ b/bootstrapvz/common/tasks/bootstrap.py @@ -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__) diff --git a/bootstrapvz/common/tasks/extlinux.py b/bootstrapvz/common/tasks/extlinux.py index 8e3cee6..0d3ee16 100644 --- a/bootstrapvz/common/tasks/extlinux.py +++ b/bootstrapvz/common/tasks/extlinux.py @@ -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 diff --git a/bootstrapvz/common/tasks/filesystem.py b/bootstrapvz/common/tasks/filesystem.py index c6b7c53..354a44b 100644 --- a/bootstrapvz/common/tasks/filesystem.py +++ b/bootstrapvz/common/tasks/filesystem.py @@ -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): diff --git a/bootstrapvz/common/tasks/folder.py b/bootstrapvz/common/tasks/folder.py index 2a55995..1f5333b 100644 --- a/bootstrapvz/common/tasks/folder.py +++ b/bootstrapvz/common/tasks/folder.py @@ -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): diff --git a/bootstrapvz/common/tasks/grub.py b/bootstrapvz/common/tasks/grub.py index a0281ea..2cc04b3 100644 --- a/bootstrapvz/common/tasks/grub.py +++ b/bootstrapvz/common/tasks/grub.py @@ -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 diff --git a/bootstrapvz/common/tasks/loopback.py b/bootstrapvz/common/tasks/loopback.py index 25d4179..83e5ee7 100644 --- a/bootstrapvz/common/tasks/loopback.py +++ b/bootstrapvz/common/tasks/loopback.py @@ -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): diff --git a/bootstrapvz/common/tasks/packages.py b/bootstrapvz/common/tasks/packages.py index 6aa400e..fe84f9c 100644 --- a/bootstrapvz/common/tasks/packages.py +++ b/bootstrapvz/common/tasks/packages.py @@ -1,6 +1,6 @@ from bootstrapvz.base import Task from .. import phases -import apt +from . import apt from ..tools import log_check_call diff --git a/bootstrapvz/common/tasks/partitioning.py b/bootstrapvz/common/tasks/partitioning.py index 3dd5b7a..f5c5d61 100644 --- a/bootstrapvz/common/tasks/partitioning.py +++ b/bootstrapvz/common/tasks/partitioning.py @@ -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): diff --git a/bootstrapvz/common/tasks/ssh.py b/bootstrapvz/common/tasks/ssh.py index d3155a8..6cd5183 100644 --- a/bootstrapvz/common/tasks/ssh.py +++ b/bootstrapvz/common/tasks/ssh.py @@ -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 diff --git a/bootstrapvz/common/tasks/volume.py b/bootstrapvz/common/tasks/volume.py index b810397..18ac44a 100644 --- a/bootstrapvz/common/tasks/volume.py +++ b/bootstrapvz/common/tasks/volume.py @@ -1,6 +1,6 @@ from bootstrapvz.base import Task from .. import phases -import workspace +from . import workspace class Attach(Task): diff --git a/bootstrapvz/common/tools.py b/bootstrapvz/common/tools.py index e935a15..eb55712 100644 --- a/bootstrapvz/common/tools.py +++ b/bootstrapvz/common/tools.py @@ -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, diff --git a/bootstrapvz/plugins/admin_user/__init__.py b/bootstrapvz/plugins/admin_user/__init__.py index 4c85874..56e5f3a 100644 --- a/bootstrapvz/plugins/admin_user/__init__.py +++ b/bootstrapvz/plugins/admin_user/__init__.py @@ -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 diff --git a/bootstrapvz/plugins/ansible/__init__.py b/bootstrapvz/plugins/ansible/__init__.py index f260281..0dde5ed 100644 --- a/bootstrapvz/plugins/ansible/__init__.py +++ b/bootstrapvz/plugins/ansible/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/apt_proxy/__init__.py b/bootstrapvz/plugins/apt_proxy/__init__.py index eae8df0..3c753e1 100644 --- a/bootstrapvz/plugins/apt_proxy/__init__.py +++ b/bootstrapvz/plugins/apt_proxy/__init__.py @@ -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): diff --git a/bootstrapvz/plugins/chef/__init__.py b/bootstrapvz/plugins/chef/__init__.py index f3a4bcd..d8b375f 100644 --- a/bootstrapvz/plugins/chef/__init__.py +++ b/bootstrapvz/plugins/chef/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/cloud_init/__init__.py b/bootstrapvz/plugins/cloud_init/__init__.py index 7e7f714..76458a8 100644 --- a/bootstrapvz/plugins/cloud_init/__init__.py +++ b/bootstrapvz/plugins/cloud_init/__init__.py @@ -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 diff --git a/bootstrapvz/plugins/commands/__init__.py b/bootstrapvz/plugins/commands/__init__.py index b525e98..ffda0b5 100644 --- a/bootstrapvz/plugins/commands/__init__.py +++ b/bootstrapvz/plugins/commands/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/debconf/__init__.py b/bootstrapvz/plugins/debconf/__init__.py index 048882f..8551015 100644 --- a/bootstrapvz/plugins/debconf/__init__.py +++ b/bootstrapvz/plugins/debconf/__init__.py @@ -7,5 +7,5 @@ def validate_manifest(data, validator, error): def resolve_tasks(taskset, manifest): - import tasks + from . import tasks taskset.update([tasks.DebconfSetSelections]) diff --git a/bootstrapvz/plugins/docker_daemon/__init__.py b/bootstrapvz/plugins/docker_daemon/__init__.py index 4e47cde..faaf8c5 100644 --- a/bootstrapvz/plugins/docker_daemon/__init__.py +++ b/bootstrapvz/plugins/docker_daemon/__init__.py @@ -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 diff --git a/bootstrapvz/plugins/ec2_launch/__init__.py b/bootstrapvz/plugins/ec2_launch/__init__.py index 1f9e9b2..2135407 100644 --- a/bootstrapvz/plugins/ec2_launch/__init__.py +++ b/bootstrapvz/plugins/ec2_launch/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/ec2_publish/__init__.py b/bootstrapvz/plugins/ec2_publish/__init__.py index 1ac8ff1..e610a76 100644 --- a/bootstrapvz/plugins/ec2_publish/__init__.py +++ b/bootstrapvz/plugins/ec2_publish/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/expand_root/__init__.py b/bootstrapvz/plugins/expand_root/__init__.py index d7fa0b5..cb5483e 100644 --- a/bootstrapvz/plugins/expand_root/__init__.py +++ b/bootstrapvz/plugins/expand_root/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks from bootstrapvz.common.tools import rel_path diff --git a/bootstrapvz/plugins/file_copy/__init__.py b/bootstrapvz/plugins/file_copy/__init__.py index e78decc..75d1857 100644 --- a/bootstrapvz/plugins/file_copy/__init__.py +++ b/bootstrapvz/plugins/file_copy/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/google_cloud_repo/__init__.py b/bootstrapvz/plugins/google_cloud_repo/__init__.py index 07d8f7c..5c9b366 100644 --- a/bootstrapvz/plugins/google_cloud_repo/__init__.py +++ b/bootstrapvz/plugins/google_cloud_repo/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks from bootstrapvz.common.tools import rel_path diff --git a/bootstrapvz/plugins/minimize_size/__init__.py b/bootstrapvz/plugins/minimize_size/__init__.py index 478da93..2d8f0a0 100644 --- a/bootstrapvz/plugins/minimize_size/__init__.py +++ b/bootstrapvz/plugins/minimize_size/__init__.py @@ -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): diff --git a/bootstrapvz/plugins/ntp/__init__.py b/bootstrapvz/plugins/ntp/__init__.py index cf0120b..caad1ef 100644 --- a/bootstrapvz/plugins/ntp/__init__.py +++ b/bootstrapvz/plugins/ntp/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/opennebula/__init__.py b/bootstrapvz/plugins/opennebula/__init__.py index 5d0fcab..67f9356 100644 --- a/bootstrapvz/plugins/opennebula/__init__.py +++ b/bootstrapvz/plugins/opennebula/__init__.py @@ -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: diff --git a/bootstrapvz/plugins/pip_install/__init__.py b/bootstrapvz/plugins/pip_install/__init__.py index 7f88abf..e74513e 100644 --- a/bootstrapvz/plugins/pip_install/__init__.py +++ b/bootstrapvz/plugins/pip_install/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/prebootstrapped/__init__.py b/bootstrapvz/plugins/prebootstrapped/__init__.py index e99015c..364509b 100644 --- a/bootstrapvz/plugins/prebootstrapped/__init__.py +++ b/bootstrapvz/plugins/prebootstrapped/__init__.py @@ -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 diff --git a/bootstrapvz/plugins/puppet/__init__.py b/bootstrapvz/plugins/puppet/__init__.py index 55ac88f..ce014c3 100644 --- a/bootstrapvz/plugins/puppet/__init__.py +++ b/bootstrapvz/plugins/puppet/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/root_password/__init__.py b/bootstrapvz/plugins/root_password/__init__.py index c2cba57..82b2a26 100644 --- a/bootstrapvz/plugins/root_password/__init__.py +++ b/bootstrapvz/plugins/root_password/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/salt/__init__.py b/bootstrapvz/plugins/salt/__init__.py index 81ed9aa..f963a77 100644 --- a/bootstrapvz/plugins/salt/__init__.py +++ b/bootstrapvz/plugins/salt/__init__.py @@ -1,4 +1,4 @@ -import tasks +from . import tasks def validate_manifest(data, validator, error): diff --git a/bootstrapvz/plugins/tmpfs_workspace/__init__.py b/bootstrapvz/plugins/tmpfs_workspace/__init__.py index 5124cd7..51cece8 100644 --- a/bootstrapvz/plugins/tmpfs_workspace/__init__.py +++ b/bootstrapvz/plugins/tmpfs_workspace/__init__.py @@ -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): diff --git a/bootstrapvz/plugins/unattended_upgrades/__init__.py b/bootstrapvz/plugins/unattended_upgrades/__init__.py index 5e0942c..b3fb427 100644 --- a/bootstrapvz/plugins/unattended_upgrades/__init__.py +++ b/bootstrapvz/plugins/unattended_upgrades/__init__.py @@ -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) diff --git a/bootstrapvz/plugins/vagrant/__init__.py b/bootstrapvz/plugins/vagrant/__init__.py index ae71103..8643231 100644 --- a/bootstrapvz/plugins/vagrant/__init__.py +++ b/bootstrapvz/plugins/vagrant/__init__.py @@ -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 diff --git a/bootstrapvz/providers/azure/__init__.py b/bootstrapvz/providers/azure/__init__.py index 784393d..f67d0c6 100644 --- a/bootstrapvz/providers/azure/__init__.py +++ b/bootstrapvz/providers/azure/__init__.py @@ -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 diff --git a/bootstrapvz/providers/docker/__init__.py b/bootstrapvz/providers/docker/__init__.py index 88eac94..7d6cc2f 100644 --- a/bootstrapvz/providers/docker/__init__.py +++ b/bootstrapvz/providers/docker/__init__.py @@ -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): diff --git a/bootstrapvz/providers/ec2/__init__.py b/bootstrapvz/providers/ec2/__init__.py index 4a3daa6..7885006 100644 --- a/bootstrapvz/providers/ec2/__init__.py +++ b/bootstrapvz/providers/ec2/__init__.py @@ -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 diff --git a/bootstrapvz/providers/ec2/tasks/ami.py b/bootstrapvz/providers/ec2/tasks/ami.py index 87acef7..bc5fbb5 100755 --- a/bootstrapvz/providers/ec2/tasks/ami.py +++ b/bootstrapvz/providers/ec2/tasks/ami.py @@ -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 diff --git a/bootstrapvz/providers/ec2/tasks/connection.py b/bootstrapvz/providers/ec2/tasks/connection.py index b35ebb3..61e9e3b 100644 --- a/bootstrapvz/providers/ec2/tasks/connection.py +++ b/bootstrapvz/providers/ec2/tasks/connection.py @@ -1,6 +1,6 @@ from bootstrapvz.base import Task from bootstrapvz.common import phases -import host +from . import host class SilenceBotoDebug(Task): diff --git a/bootstrapvz/providers/gce/__init__.py b/bootstrapvz/providers/gce/__init__.py index 33f3029..b69b457 100644 --- a/bootstrapvz/providers/gce/__init__.py +++ b/bootstrapvz/providers/gce/__init__.py @@ -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 diff --git a/bootstrapvz/providers/kvm/__init__.py b/bootstrapvz/providers/kvm/__init__.py index 4104af0..3be8bf7 100644 --- a/bootstrapvz/providers/kvm/__init__.py +++ b/bootstrapvz/providers/kvm/__init__.py @@ -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): diff --git a/bootstrapvz/providers/oracle/__init__.py b/bootstrapvz/providers/oracle/__init__.py index 315810f..cd96922 100644 --- a/bootstrapvz/providers/oracle/__init__.py +++ b/bootstrapvz/providers/oracle/__init__.py @@ -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): diff --git a/bootstrapvz/providers/virtualbox/__init__.py b/bootstrapvz/providers/virtualbox/__init__.py index 6a05ac9..2459cd4 100644 --- a/bootstrapvz/providers/virtualbox/__init__.py +++ b/bootstrapvz/providers/virtualbox/__init__.py @@ -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, diff --git a/bootstrapvz/remote/build_servers/__init__.py b/bootstrapvz/remote/build_servers/__init__.py index f62e6f4..8865558 100644 --- a/bootstrapvz/remote/build_servers/__init__.py +++ b/bootstrapvz/remote/build_servers/__init__.py @@ -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.') diff --git a/bootstrapvz/remote/build_servers/local.py b/bootstrapvz/remote/build_servers/local.py index db2dec6..6dd5e09 100644 --- a/bootstrapvz/remote/build_servers/local.py +++ b/bootstrapvz/remote/build_servers/local.py @@ -1,4 +1,4 @@ -from build_server import BuildServer +from .build_server import BuildServer from contextlib import contextmanager diff --git a/bootstrapvz/remote/build_servers/remote.py b/bootstrapvz/remote/build_servers/remote.py index f6b5449..d02cf2e 100644 --- a/bootstrapvz/remote/build_servers/remote.py +++ b/bootstrapvz/remote/build_servers/remote.py @@ -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) diff --git a/bootstrapvz/remote/main.py b/bootstrapvz/remote/main.py index d48c98d..6ffe8ca 100644 --- a/bootstrapvz/remote/main.py +++ b/bootstrapvz/remote/main.py @@ -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'] diff --git a/bootstrapvz/remote/server.py b/bootstrapvz/remote/server.py index 92b2095..72e874e 100644 --- a/bootstrapvz/remote/server.py +++ b/bootstrapvz/remote/server.py @@ -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) diff --git a/tests/system/docker_tests.py b/tests/system/docker_tests.py index 720f584..9aa30dd 100644 --- a/tests/system/docker_tests.py +++ b/tests/system/docker_tests.py @@ -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: diff --git a/tests/system/ec2_ebs_hvm_tests.py b/tests/system/ec2_ebs_hvm_tests.py index a517d65..ebd2c8e 100644 --- a/tests/system/ec2_ebs_hvm_tests.py +++ b/tests/system/ec2_ebs_hvm_tests.py @@ -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: diff --git a/tests/system/ec2_ebs_pvm_tests.py b/tests/system/ec2_ebs_pvm_tests.py index cb006f5..56e2d37 100644 --- a/tests/system/ec2_ebs_pvm_tests.py +++ b/tests/system/ec2_ebs_pvm_tests.py @@ -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: diff --git a/tests/system/ec2_s3_pvm_tests.py b/tests/system/ec2_s3_pvm_tests.py index 51c0a2d..7389123 100644 --- a/tests/system/ec2_s3_pvm_tests.py +++ b/tests/system/ec2_s3_pvm_tests.py @@ -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)) diff --git a/tests/system/providers/docker/__init__.py b/tests/system/providers/docker/__init__.py index 9076039..15ceed3 100644 --- a/tests/system/providers/docker/__init__.py +++ b/tests/system/providers/docker/__init__.py @@ -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: diff --git a/tests/system/providers/ec2/__init__.py b/tests/system/providers/ec2/__init__.py index 09c095a..795760b 100644 --- a/tests/system/providers/ec2/__init__.py +++ b/tests/system/providers/ec2/__init__.py @@ -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: diff --git a/tests/system/providers/virtualbox/__init__.py b/tests/system/providers/virtualbox/__init__.py index 9dc1bd4..e0b6341 100644 --- a/tests/system/providers/virtualbox/__init__.py +++ b/tests/system/providers/virtualbox/__init__.py @@ -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: diff --git a/tests/system/tools/__init__.py b/tests/system/tools/__init__.py index 5af0a67..6db90ce 100644 --- a/tests/system/tools/__init__.py +++ b/tests/system/tools/__init__.py @@ -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)) diff --git a/tests/system/virtualbox_tests.py b/tests/system/virtualbox_tests.py index 62883d3..87cf6b4 100644 --- a/tests/system/virtualbox_tests.py +++ b/tests/system/virtualbox_tests.py @@ -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}}',