From: Kyr Shatskyy Date: Thu, 2 May 2019 13:45:25 +0000 (+0200) Subject: py3: make imports python2/3 compatible X-Git-Tag: 1.1.0~242^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ae866630d2c33ad828733d2a63a24613f8aab417;p=teuthology.git py3: make imports python2/3 compatible Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/__init__.py b/teuthology/__init__.py index 6f0b619c31..591c92e6c2 100644 --- a/teuthology/__init__.py +++ b/teuthology/__init__.py @@ -24,7 +24,7 @@ from gevent.hub import Hub # Don't write pyc files sys.dont_write_bytecode = True -from .orchestra import monkey +from teuthology.orchestra import monkey monkey.patch_all() import logging diff --git a/teuthology/beanstalk.py b/teuthology/beanstalk.py index 8d97e82f83..672a42548c 100644 --- a/teuthology/beanstalk.py +++ b/teuthology/beanstalk.py @@ -5,8 +5,8 @@ import pprint import sys from collections import OrderedDict -from .config import config -from . import report +from teuthology.config import config +from teuthology import report log = logging.getLogger(__name__) diff --git a/teuthology/contextutil.py b/teuthology/contextutil.py index be9800301a..148ec43837 100644 --- a/teuthology/contextutil.py +++ b/teuthology/contextutil.py @@ -4,8 +4,8 @@ import logging import time import itertools -from .config import config -from .exceptions import MaxWhileTries +from teuthology.config import config +from teuthology.exceptions import MaxWhileTries log = logging.getLogger(__name__) @@ -36,7 +36,7 @@ def nested(*managers): # FIXME this needs to be more generic if config.ctx and config.ctx.config.get('interactive-on-error'): config.ctx.config['interactive-on-error'] = False - from .task import interactive + from teuthology.task import interactive log.warning('Saw failure, going into interactive mode...') interactive.task(ctx=config.ctx, config=None) finally: diff --git a/teuthology/kill.py b/teuthology/kill.py index 10f90185ba..931c7872f2 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -8,10 +8,10 @@ import tempfile import logging import getpass -from . import beanstalk -from . import report -from .config import config -from . import misc +from teuthology import beanstalk +from teuthology import report +from teuthology.config import config +from teuthology import misc log = logging.getLogger(__name__) diff --git a/teuthology/lock/keys.py b/teuthology/lock/keys.py index 4aafc26a3d..9f8497e50b 100644 --- a/teuthology/lock/keys.py +++ b/teuthology/lock/keys.py @@ -2,7 +2,7 @@ import logging from teuthology import misc -from . import ops, query +from teuthology.lock import ops, query log = logging.getLogger(__name__) diff --git a/teuthology/ls.py b/teuthology/ls.py index e78d5c8533..ff4e6f8454 100644 --- a/teuthology/ls.py +++ b/teuthology/ls.py @@ -3,7 +3,7 @@ import yaml import errno import re -from .job_status import get_status +from teuthology.job_status import get_status def main(args): diff --git a/teuthology/misc.py b/teuthology/misc.py index 164cea7d22..52c304c571 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -26,10 +26,10 @@ from netaddr.strategy.ipv6 import valid_str as _is_ipv6 from teuthology import safepath from teuthology.exceptions import (CommandCrashedError, CommandFailedError, ConnectionLostError) -from .orchestra import run -from .config import config -from .contextutil import safe_while -from .orchestra.opsys import DEFAULT_OS_VERSION +from teuthology.orchestra import run +from teuthology.config import config +from teuthology.contextutil import safe_while +from teuthology.orchestra.opsys import DEFAULT_OS_VERSION log = logging.getLogger(__name__) diff --git a/teuthology/nuke/__init__.py b/teuthology/nuke/__init__.py index 2b2e4ae9ed..260dc29e6e 100644 --- a/teuthology/nuke/__init__.py +++ b/teuthology/nuke/__init__.py @@ -13,7 +13,7 @@ from teuthology.lock.ops import unlock_one from teuthology.lock.query import is_vm, list_locks, \ find_stale_locks, get_status from teuthology.lock.util import locked_since_seconds -from .actions import ( +from teuthology.nuke.actions import ( check_console, clear_firewall, shutdown_daemons, remove_installed_packages, reboot, remove_osd_mounts, remove_osd_tmpfs, kill_hadoop, remove_ceph_packages, synch_clocks, unlock_firmware_repo, @@ -21,15 +21,15 @@ from .actions import ( remove_ceph_data, remove_testing_tree, remove_yum_timedhosts, kill_valgrind, ) -from ..config import config, FakeNamespace -from ..misc import ( +from teuthology.config import config, FakeNamespace +from teuthology.misc import ( canonicalize_hostname, config_file, decanonicalize_hostname, merge_configs, get_user, sh ) -from ..openstack import OpenStack, OpenStackInstance, enforce_json_dictionary -from ..orchestra.remote import Remote -from ..parallel import parallel -from ..task.internal import check_lock, add_remotes, connect +from teuthology.openstack import OpenStack, OpenStackInstance, enforce_json_dictionary +from teuthology.orchestra.remote import Remote +from teuthology.parallel import parallel +from teuthology.task.internal import check_lock, add_remotes, connect log = logging.getLogger(__name__) diff --git a/teuthology/nuke/actions.py b/teuthology/nuke/actions.py index d994ca95c0..58b56ca699 100644 --- a/teuthology/nuke/actions.py +++ b/teuthology/nuke/actions.py @@ -1,10 +1,10 @@ import logging import time -from ..misc import get_testdir, reconnect -from ..orchestra import run -from ..orchestra.remote import Remote -from ..task import install as install_task +from teuthology.misc import get_testdir, reconnect +from teuthology.orchestra import run +from teuthology.orchestra.remote import Remote +from teuthology.task import install as install_task log = logging.getLogger(__name__) diff --git a/teuthology/orchestra/connection.py b/teuthology/orchestra/connection.py index 969f8b0eb9..3b26dfb5f0 100644 --- a/teuthology/orchestra/connection.py +++ b/teuthology/orchestra/connection.py @@ -6,8 +6,8 @@ import paramiko import os import logging -from ..config import config -from ..contextutil import safe_while +from teuthology.config import config +from teuthology.contextutil import safe_while log = logging.getLogger(__name__) diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 82dd8e6875..5a36dc654d 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -10,8 +10,7 @@ import teuthology.lock.query import teuthology.lock.util from teuthology.config import config from teuthology.contextutil import safe_while - -from ..exceptions import ConsoleError +from teuthology.exceptions import ConsoleError import remote diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 5f1285da13..db8317b99e 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -3,8 +3,8 @@ Support for paramiko remote objects. """ import teuthology.lock.query import teuthology.lock.util -from . import run -from .opsys import OS +from teuthology.orchestra import run +from teuthology.orchestra.opsys import OS import connection from teuthology import misc from teuthology.misc import host_shortname diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 33c50e35c7..ef9aabc676 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -11,9 +11,9 @@ import pipes import logging import shutil -from ..contextutil import safe_while -from ..exceptions import (CommandCrashedError, CommandFailedError, - ConnectionLostError) +from teuthology.contextutil import safe_while +from teuthology.exceptions import (CommandCrashedError, CommandFailedError, + ConnectionLostError) log = logging.getLogger(__name__) diff --git a/teuthology/orchestra/test/test_cluster.py b/teuthology/orchestra/test/test_cluster.py index 6b3a9836d3..ca51dd3b41 100644 --- a/teuthology/orchestra/test/test_cluster.py +++ b/teuthology/orchestra/test/test_cluster.py @@ -3,7 +3,7 @@ import pytest from mock import patch, Mock -from .. import cluster, remote +from teuthology.orchestra import cluster, remote class TestCluster(object): diff --git a/teuthology/orchestra/test/test_connection.py b/teuthology/orchestra/test/test_connection.py index ef13c1edff..3fd034d95f 100644 --- a/teuthology/orchestra/test/test_connection.py +++ b/teuthology/orchestra/test/test_connection.py @@ -1,8 +1,8 @@ import fudge from teuthology import config -from .util import assert_raises -from .. import connection +from teuthology.orchestra import connection +from teuthology.orchestra.test.util import assert_raises class TestConnection(object): diff --git a/teuthology/orchestra/test/test_console.py b/teuthology/orchestra/test/test_console.py index 1e37abd73c..0338a577ba 100644 --- a/teuthology/orchestra/test/test_console.py +++ b/teuthology/orchestra/test/test_console.py @@ -2,7 +2,7 @@ from mock import patch from teuthology.config import config as teuth_config -from .. import console +from teuthology.orchestra import console class TestConsole(object): diff --git a/teuthology/orchestra/test/test_opsys.py b/teuthology/orchestra/test/test_opsys.py index 5f05bdd68b..c8f6e0bd3d 100644 --- a/teuthology/orchestra/test/test_opsys.py +++ b/teuthology/orchestra/test/test_opsys.py @@ -1,5 +1,5 @@ from textwrap import dedent -from ..opsys import OS +from teuthology.orchestra.opsys import OS import pytest diff --git a/teuthology/orchestra/test/test_remote.py b/teuthology/orchestra/test/test_remote.py index e17f42400c..6a77201634 100644 --- a/teuthology/orchestra/test/test_remote.py +++ b/teuthology/orchestra/test/test_remote.py @@ -2,9 +2,9 @@ from mock import patch, Mock, MagicMock from cStringIO import StringIO -from .. import remote -from .. import opsys -from ..run import RemoteProcess +from teuthology.orchestra import remote +from teuthology.orchestra import opsys +from teuthology.orchestra.run import RemoteProcess class TestRemote(object): diff --git a/teuthology/orchestra/test/test_run.py b/teuthology/orchestra/test/test_run.py index c14a148e06..acbf85514d 100644 --- a/teuthology/orchestra/test/test_run.py +++ b/teuthology/orchestra/test/test_run.py @@ -6,7 +6,7 @@ import socket from mock import MagicMock, patch from pytest import raises -from .. import run +from teuthology.orchestra import run from teuthology.exceptions import (CommandCrashedError, CommandFailedError, ConnectionLostError) diff --git a/teuthology/packaging.py b/teuthology/packaging.py index 349dbbcabc..a9912f4250 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -8,15 +8,15 @@ import urlparse from collections import OrderedDict from cStringIO import StringIO -from . import repo_utils +from teuthology import repo_utils -from .config import config -from .contextutil import safe_while -from .exceptions import (VersionNotFoundError, CommitNotFoundError, +from teuthology.config import config +from teuthology.contextutil import safe_while +from teuthology.exceptions import (VersionNotFoundError, CommitNotFoundError, NoRemoteError) -from .misc import sudo_write_file -from .orchestra.opsys import OS, DEFAULT_OS_VERSION -from .orchestra.run import Raw +from teuthology.misc import sudo_write_file +from teuthology.orchestra.opsys import OS, DEFAULT_OS_VERSION +from teuthology.orchestra.run import Raw log = logging.getLogger(__name__) diff --git a/teuthology/provision/__init__.py b/teuthology/provision/__init__.py index 261bc018c0..bec9bfe381 100644 --- a/teuthology/provision/__init__.py +++ b/teuthology/provision/__init__.py @@ -1,7 +1,7 @@ import logging import teuthology.lock.query -from ..misc import decanonicalize_hostname, get_distro, get_distro_version +from teuthology.misc import decanonicalize_hostname, get_distro, get_distro_version import cloud import downburst diff --git a/teuthology/provision/downburst.py b/teuthology/provision/downburst.py index 62f29e3525..d61fadfa30 100644 --- a/teuthology/provision/downburst.py +++ b/teuthology/provision/downburst.py @@ -5,9 +5,9 @@ import subprocess import tempfile import yaml -from ..config import config -from ..contextutil import safe_while -from ..misc import decanonicalize_hostname +from teuthology.config import config +from teuthology.contextutil import safe_while +from teuthology.misc import decanonicalize_hostname from teuthology.lock import query log = logging.getLogger(__name__) diff --git a/teuthology/provision/fog.py b/teuthology/provision/fog.py index fc28ecdfcf..607e01db4d 100644 --- a/teuthology/provision/fog.py +++ b/teuthology/provision/fog.py @@ -9,8 +9,8 @@ from StringIO import StringIO import teuthology.orchestra -from ..config import config -from ..contextutil import safe_while +from teuthology.config import config +from teuthology.contextutil import safe_while from teuthology.exceptions import MaxWhileTries from teuthology import misc diff --git a/teuthology/provision/openstack.py b/teuthology/provision/openstack.py index affb24ba0b..fc211414f5 100644 --- a/teuthology/provision/openstack.py +++ b/teuthology/provision/openstack.py @@ -9,12 +9,12 @@ import tempfile from subprocess import CalledProcessError -from .. import misc +from teuthology import misc -from ..openstack import OpenStack, OpenStackInstance -from ..config import config -from ..contextutil import safe_while -from ..exceptions import QuotaExceededError +from teuthology.openstack import OpenStack, OpenStackInstance +from teuthology.config import config +from teuthology.contextutil import safe_while +from teuthology.exceptions import QuotaExceededError log = logging.getLogger(__name__) diff --git a/teuthology/repo_utils.py b/teuthology/repo_utils.py index a0da17f6d5..685cfa5a97 100644 --- a/teuthology/repo_utils.py +++ b/teuthology/repo_utils.py @@ -6,9 +6,9 @@ import subprocess import time from teuthology.util.flock import FileLock -from .config import config -from .contextutil import MaxWhileTries, safe_while -from .exceptions import BootstrapError, BranchNotFoundError, GitError +from teuthology.config import config +from teuthology.contextutil import MaxWhileTries, safe_while +from teuthology.exceptions import BootstrapError, BranchNotFoundError, GitError log = logging.getLogger(__name__) diff --git a/teuthology/report.py b/teuthology/report.py index 8f37a97e7f..a9fcc2220c 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -8,8 +8,8 @@ import socket from datetime import datetime import teuthology -from .config import config -from .job_status import get_status, set_status +from teuthology.config import config +from teuthology.job_status import get_status, set_status report_exceptions = (requests.exceptions.RequestException, socket.error) diff --git a/teuthology/results.py b/teuthology/results.py index c5baa91b27..c79303e065 100644 --- a/teuthology/results.py +++ b/teuthology/results.py @@ -10,7 +10,7 @@ from textwrap import fill import teuthology from teuthology.config import config from teuthology import misc -from .report import ResultsReporter +from teuthology.report import ResultsReporter log = logging.getLogger(__name__) diff --git a/teuthology/run.py b/teuthology/run.py index f61f2a6f28..bd7f49ebe3 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -7,15 +7,15 @@ import logging import teuthology from teuthology import install_except_hook -from . import report -from .job_status import get_status -from .misc import get_user, merge_configs -from .nuke import nuke -from .run_tasks import run_tasks -from .repo_utils import fetch_qa_suite -from .results import email_results -from .config import FakeNamespace -from .config import config as teuth_config +from teuthology import report +from teuthology.job_status import get_status +from teuthology.misc import get_user, merge_configs +from teuthology.nuke import nuke +from teuthology.run_tasks import run_tasks +from teuthology.repo_utils import fetch_qa_suite +from teuthology.results import email_results +from teuthology.config import FakeNamespace +from teuthology.config import config as teuth_config log = logging.getLogger(__name__) diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index 2c364572bb..36d47739a7 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -5,12 +5,12 @@ import types from copy import deepcopy -from .config import config as teuth_config -from .exceptions import ConnectionLostError -from .job_status import set_status -from .misc import get_http_log_path -from .sentry import get_client as get_sentry_client -from .timer import Timer +from teuthology.config import config as teuth_config +from teuthology.exceptions import ConnectionLostError +from teuthology.job_status import set_status +from teuthology.misc import get_http_log_path +from teuthology.sentry import get_client as get_sentry_client +from teuthology.timer import Timer log = logging.getLogger(__name__) @@ -136,7 +136,7 @@ def run_tasks(tasks, ctx): if ctx.config.get('interactive-on-error'): ctx.config['interactive-on-error'] = False - from .task import interactive + from teuthology.task import interactive log.warning('Saw failure during task execution, going into interactive mode...') interactive.task(ctx=ctx, config=None) # Throughout teuthology, (x,) = y has been used to assign values @@ -173,7 +173,7 @@ def run_tasks(tasks, ctx): exc_info = sys.exc_info() if ctx.config.get('interactive-on-error'): - from .task import interactive + from tuethology.task import interactive log.warning( 'Saw failure during task cleanup, going into interactive mode...') interactive.task(ctx=ctx, config=None) diff --git a/teuthology/sentry.py b/teuthology/sentry.py index 3d83a29136..655aea185a 100644 --- a/teuthology/sentry.py +++ b/teuthology/sentry.py @@ -1,6 +1,6 @@ import logging from raven import Client -from .config import config +from teuthology.config import config log = logging.getLogger(__name__) diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index 488b104b39..3f30170ccf 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -9,12 +9,12 @@ import time from distutils.util import strtobool import teuthology -from ..config import config, YamlConfig -from ..report import ResultsReporter -from ..results import UNFINISHED_STATUSES +from teuthology.config import config, YamlConfig +from teuthology.report import ResultsReporter +from teuthology.results import UNFINISHED_STATUSES -from .run import Run -from .util import schedule_fail +from teuthology.suite.run import Run +from teuthology.suite.util import schedule_fail log = logging.getLogger(__name__) diff --git a/teuthology/suite/build_matrix.py b/teuthology/suite/build_matrix.py index 165711c1cd..9ea1d4b6bf 100644 --- a/teuthology/suite/build_matrix.py +++ b/teuthology/suite/build_matrix.py @@ -2,7 +2,7 @@ import logging import os import random -from . import matrix +from teuthology.suite import matrix log = logging.getLogger(__name__) diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index e34e6012d3..09b232123f 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -9,16 +9,16 @@ import yaml from datetime import datetime from tempfile import NamedTemporaryFile -from ..config import config, JobConfig -from ..exceptions import ( +from teuthology.config import config, JobConfig +from teuthology.exceptions import ( BranchNotFoundError, CommitNotFoundError, VersionNotFoundError ) -from ..misc import deep_merge, get_results_url -from ..orchestra.opsys import OS +from teuthology.misc import deep_merge, get_results_url +from teuthology.orchestra.opsys import OS -from . import util -from .build_matrix import combine_path, build_matrix -from .placeholder import substitute_placeholders, dict_templ +from teuthology.suite import util +from teuthology.suite.build_matrix import combine_path, build_matrix +from teuthology.suite.placeholder import substitute_placeholders, dict_templ log = logging.getLogger(__name__) diff --git a/teuthology/suite/util.py b/teuthology/suite/util.py index 0f7d205c2b..f4d939b2a5 100644 --- a/teuthology/suite/util.py +++ b/teuthology/suite/util.py @@ -11,16 +11,16 @@ from email.mime.text import MIMEText import teuthology.lock.query import teuthology.lock.util -from .. import repo_utils - -from ..config import config -from ..exceptions import BranchNotFoundError, ScheduleFailError -from ..misc import deep_merge -from ..repo_utils import fetch_qa_suite, fetch_teuthology -from ..orchestra.opsys import OS -from ..packaging import get_builder_project -from ..repo_utils import build_git_url -from ..task.install import get_flavor +from teuthology import repo_utils + +from teuthology.config import config +from teuthology.exceptions import BranchNotFoundError, ScheduleFailError +from teuthology.misc import deep_merge +from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology +from teuthology.orchestra.opsys import OS +from teuthology.packaging import get_builder_project +from teuthology.repo_utils import build_git_url +from teuthology.task.install import get_flavor log = logging.getLogger(__name__) diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index 1b535e58dc..30f799d66e 100644 --- a/teuthology/task/ansible.py +++ b/teuthology/task/ansible.py @@ -14,7 +14,7 @@ from teuthology.exceptions import CommandFailedError, AnsibleFailedError from teuthology.job_status import set_status from teuthology.repo_utils import fetch_repo -from . import Task +from teuthology.task import Task log = logging.getLogger(__name__) diff --git a/teuthology/task/background_exec.py b/teuthology/task/background_exec.py index 76d58bd40d..c954224215 100644 --- a/teuthology/task/background_exec.py +++ b/teuthology/task/background_exec.py @@ -6,7 +6,7 @@ import contextlib import logging from teuthology import misc -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index ae68632541..63b2c848bc 100644 --- a/teuthology/task/ceph_ansible.py +++ b/teuthology/task/ceph_ansible.py @@ -6,10 +6,10 @@ import yaml from cStringIO import StringIO -from . import Task +from teuthology.task import Task from tempfile import NamedTemporaryFile -from ..config import config as teuth_config -from ..misc import get_scratch_devices +from teuthology.config import config as teuth_config +from teuthology.misc import get_scratch_devices from teuthology import contextutil from teuthology.orchestra import run from teuthology import misc diff --git a/teuthology/task/cephmetrics.py b/teuthology/task/cephmetrics.py index 5f68934edd..6e4b677a65 100644 --- a/teuthology/task/cephmetrics.py +++ b/teuthology/task/cephmetrics.py @@ -6,7 +6,7 @@ import time from teuthology.config import config as teuth_config from teuthology.exceptions import CommandFailedError -from .ansible import Ansible, LoggerFile +from teuthology.ansible import Ansible, LoggerFile log = logging.getLogger(__name__) diff --git a/teuthology/task/clock.py b/teuthology/task/clock.py index 53a349c866..cfabad29e7 100644 --- a/teuthology/task/clock.py +++ b/teuthology/task/clock.py @@ -5,7 +5,7 @@ import logging import contextlib import os -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) diff --git a/teuthology/task/console_log.py b/teuthology/task/console_log.py index ab94ed2abb..7c1c701421 100644 --- a/teuthology/task/console_log.py +++ b/teuthology/task/console_log.py @@ -3,8 +3,7 @@ import os from teuthology.orchestra.cluster import Cluster from teuthology.exit import exiter - -from . import Task +from teuthology.task import Task log = logging.getLogger(__name__) diff --git a/teuthology/task/hadoop.py b/teuthology/task/hadoop.py index d4e1a49fd5..a798695d83 100644 --- a/teuthology/task/hadoop.py +++ b/teuthology/task/hadoop.py @@ -3,8 +3,8 @@ import contextlib import logging from teuthology import misc as teuthology from teuthology import contextutil -from ..orchestra import run -from ..exceptions import UnsupportedPackageTypeError +from teuthology.orchestra import run +from teuthology.exceptions import UnsupportedPackageTypeError log = logging.getLogger(__name__) diff --git a/teuthology/task/install/__init__.py b/teuthology/task/install/__init__.py index 180e4e8be0..4d67bab0df 100644 --- a/teuthology/task/install/__init__.py +++ b/teuthology/task/install/__init__.py @@ -12,11 +12,11 @@ from teuthology.orchestra import run from teuthology.task import ansible from distutils.version import LooseVersion -from .util import ( +from teuthology.task.install.util import ( _get_builder_project, get_flavor, ship_utilities, ) -from . import rpm, deb, redhat +from teuthology.task.install import rpm, deb, redhat log = logging.getLogger(__name__) diff --git a/teuthology/task/install/deb.py b/teuthology/task/install/deb.py index e259e4809f..be4f344da4 100644 --- a/teuthology/task/install/deb.py +++ b/teuthology/task/install/deb.py @@ -5,7 +5,7 @@ from cStringIO import StringIO from teuthology.orchestra import run -from .util import _get_builder_project, _get_local_dir +from teuthology.task.install.util import _get_builder_project, _get_local_dir log = logging.getLogger(__name__) diff --git a/teuthology/task/install/rpm.py b/teuthology/task/install/rpm.py index 3eed1b7c5c..b6ce52c4ed 100644 --- a/teuthology/task/install/rpm.py +++ b/teuthology/task/install/rpm.py @@ -7,7 +7,7 @@ from teuthology.config import config as teuth_config from teuthology.orchestra import run from teuthology import packaging -from .util import _get_builder_project, _get_local_dir +from teuthology.task.install.util import _get_builder_project, _get_local_dir log = logging.getLogger(__name__) diff --git a/teuthology/task/internal/__init__.py b/teuthology/task/internal/__init__.py index 7d775d4b66..65ba9474a2 100644 --- a/teuthology/task/internal/__init__.py +++ b/teuthology/task/internal/__init__.py @@ -19,7 +19,6 @@ from teuthology.config import config as teuth_config from teuthology.exceptions import VersionNotFoundError from teuthology.job_status import get_status, set_status from teuthology.orchestra import cluster, remote, run -from .redhat import setup_cdn_repo, setup_base_repo, setup_additional_repo # noqa log = logging.getLogger(__name__) diff --git a/teuthology/task/iscsi.py b/teuthology/task/iscsi.py index d83fbd2507..8c27ae6941 100644 --- a/teuthology/task/iscsi.py +++ b/teuthology/task/iscsi.py @@ -10,7 +10,7 @@ from teuthology import misc as teuthology from teuthology import contextutil from teuthology.task.common_fs_utils import generic_mkfs from teuthology.task.common_fs_utils import generic_mount -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index 60c613e41f..d453b31bed 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -12,13 +12,13 @@ import urlparse from teuthology import misc as teuthology from teuthology.parallel import parallel from teuthology.config import config as teuth_config -from ..orchestra import run -from ..exceptions import ( +from teuthology.orchestra import run +from teuthology.exceptions import ( UnsupportedPackageTypeError, ConfigError, VersionNotFoundError, ) -from ..packaging import ( +from teuthology.packaging import ( install_package, get_koji_build_info, get_kojiroot_base_url, diff --git a/teuthology/task/lockfile.py b/teuthology/task/lockfile.py index 9843a28fbc..0c74e83581 100644 --- a/teuthology/task/lockfile.py +++ b/teuthology/task/lockfile.py @@ -4,7 +4,7 @@ Locking tests import logging import os -from ..orchestra import run +from teuthology.orchestra import run from teuthology import misc as teuthology import time import gevent diff --git a/teuthology/task/parallel_example.py b/teuthology/task/parallel_example.py index 3d871af226..f39a09c796 100644 --- a/teuthology/task/parallel_example.py +++ b/teuthology/task/parallel_example.py @@ -6,7 +6,7 @@ import logging from teuthology import misc as teuthology from teuthology import contextutil -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) diff --git a/teuthology/task/pcp.py b/teuthology/task/pcp.py index 065bde00f1..a09c56c365 100644 --- a/teuthology/task/pcp.py +++ b/teuthology/task/pcp.py @@ -14,7 +14,7 @@ from teuthology.orchestra import run from teuthology import misc -from . import Task +from teuthology.task import Task log = logging.getLogger(__name__) diff --git a/teuthology/task/proc_thrasher.py b/teuthology/task/proc_thrasher.py index 1c1100fc56..c01911c5a8 100644 --- a/teuthology/task/proc_thrasher.py +++ b/teuthology/task/proc_thrasher.py @@ -6,7 +6,7 @@ import gevent import random import time -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) diff --git a/teuthology/task/selinux.py b/teuthology/task/selinux.py index a594564fe2..cf4d11b280 100644 --- a/teuthology/task/selinux.py +++ b/teuthology/task/selinux.py @@ -8,7 +8,7 @@ from teuthology.misc import get_archive_dir from teuthology.orchestra.cluster import Cluster from teuthology.orchestra import run -from . import Task +from teuthology.task import Task log = logging.getLogger(__name__) diff --git a/teuthology/task/ssh_keys.py b/teuthology/task/ssh_keys.py index dc8ac859f8..173113c955 100644 --- a/teuthology/task/ssh_keys.py +++ b/teuthology/task/ssh_keys.py @@ -11,7 +11,7 @@ from datetime import datetime from cStringIO import StringIO from teuthology import contextutil import teuthology.misc as misc -from ..orchestra import run +from teuthology.orchestra import run log = logging.getLogger(__name__) ssh_keys_user = 'ssh-keys-user' diff --git a/teuthology/test/task/test_ansible.py b/teuthology/test/task/test_ansible.py index a255e5e9d7..43be9b70bd 100644 --- a/teuthology/test/task/test_ansible.py +++ b/teuthology/test/task/test_ansible.py @@ -13,8 +13,7 @@ from teuthology.orchestra.remote import Remote from teuthology.task import ansible from teuthology.task.ansible import Ansible, CephLab -from . import TestTask - +from teuthology.test.task import TestTask class TestAnsibleTask(TestTask): klass = Ansible diff --git a/teuthology/test/task/test_ceph_ansible.py b/teuthology/test/task/test_ceph_ansible.py index 85ae129a3e..8745af116c 100644 --- a/teuthology/test/task/test_ceph_ansible.py +++ b/teuthology/test/task/test_ceph_ansible.py @@ -8,7 +8,7 @@ from teuthology.orchestra.remote import Remote from teuthology.task import ceph_ansible from teuthology.task.ceph_ansible import CephAnsible -from . import TestTask +from teuthology.test.task import TestTask SKIP_IRRELEVANT = "Not relevant to this subclass" diff --git a/teuthology/test/task/test_console_log.py b/teuthology/test/task/test_console_log.py index 0357996150..132d503264 100644 --- a/teuthology/test/task/test_console_log.py +++ b/teuthology/test/task/test_console_log.py @@ -8,7 +8,7 @@ from teuthology.orchestra.cluster import Cluster from teuthology.orchestra.remote import Remote from teuthology.task.console_log import ConsoleLog -from . import TestTask +from teuthology.test.task import TestTask class TestConsoleLog(TestTask): diff --git a/teuthology/test/task/test_pcp.py b/teuthology/test/task/test_pcp.py index 0e13234029..d49416903d 100644 --- a/teuthology/test/task/test_pcp.py +++ b/teuthology/test/task/test_pcp.py @@ -12,7 +12,7 @@ from teuthology.orchestra.run import Raw from teuthology.task.pcp import (PCPDataSource, PCPArchive, PCPGrapher, GrafanaGrapher, GraphiteGrapher, PCP) -from . import TestTask +from teuthology.test.task import TestTask pcp_host = 'http://pcp.front.sepia.ceph.com:44323/' diff --git a/teuthology/test/test_config.py b/teuthology/test/test_config.py index 2b84f80992..cbf7c3ecfb 100644 --- a/teuthology/test/test_config.py +++ b/teuthology/test/test_config.py @@ -1,6 +1,6 @@ import pytest -from .. import config +from teuthology import config class TestYamlConfig(object): diff --git a/teuthology/test/test_get_distro.py b/teuthology/test/test_get_distro.py index f3c96586eb..71104d39b4 100644 --- a/teuthology/test/test_get_distro.py +++ b/teuthology/test/test_get_distro.py @@ -1,4 +1,4 @@ -from ..misc import get_distro +from teuthology.misc import get_distro class Mock: diff --git a/teuthology/test/test_get_distro_version.py b/teuthology/test/test_get_distro_version.py index 4b66093959..39e89195cd 100644 --- a/teuthology/test/test_get_distro_version.py +++ b/teuthology/test/test_get_distro_version.py @@ -1,4 +1,4 @@ -from ..misc import get_distro_version +from teuthology.misc import get_distro_version class Mock: diff --git a/teuthology/test/test_get_multi_machine_types.py b/teuthology/test/test_get_multi_machine_types.py index c6013f436c..32a6b0263d 100644 --- a/teuthology/test/test_get_multi_machine_types.py +++ b/teuthology/test/test_get_multi_machine_types.py @@ -1,4 +1,4 @@ -from .. import misc as teuthology +from teuthology import misc as teuthology class Mock: pass diff --git a/teuthology/test/test_job_status.py b/teuthology/test/test_job_status.py index d04ace43d4..ee1b764e4f 100644 --- a/teuthology/test/test_job_status.py +++ b/teuthology/test/test_job_status.py @@ -1,4 +1,4 @@ -from .. import job_status +from teuthology import job_status class TestJobStatus(object): diff --git a/teuthology/test/test_misc.py b/teuthology/test/test_misc.py index 3168595308..87e330d73b 100644 --- a/teuthology/test/test_misc.py +++ b/teuthology/test/test_misc.py @@ -2,9 +2,9 @@ import argparse from datetime import datetime from mock import Mock, patch -from ..orchestra import cluster -from .. import misc -from ..config import config +from teuthology.orchestra import cluster +from teuthology.config import config +from teuthology import misc import subprocess import pytest diff --git a/teuthology/test/test_parallel.py b/teuthology/test/test_parallel.py index 526b0a7278..bba1d57bf7 100644 --- a/teuthology/test/test_parallel.py +++ b/teuthology/test/test_parallel.py @@ -1,4 +1,4 @@ -from ..parallel import parallel +from teuthology.parallel import parallel def identity(item, input_set=None, remove=False): diff --git a/teuthology/test/test_repo_utils.py b/teuthology/test/test_repo_utils.py index f49bfb476b..9ee0aed691 100644 --- a/teuthology/test/test_repo_utils.py +++ b/teuthology/test/test_repo_utils.py @@ -6,9 +6,9 @@ import shutil import subprocess import tempfile -from ..exceptions import BranchNotFoundError -from .. import repo_utils -from .. import parallel +from teuthology.exceptions import BranchNotFoundError +from teuthology import repo_utils +from teuthology import parallel repo_utils.log.setLevel(logging.WARNING) diff --git a/teuthology/test/test_report.py b/teuthology/test/test_report.py index 851caebeed..c26c34e945 100644 --- a/teuthology/test/test_report.py +++ b/teuthology/test/test_report.py @@ -1,7 +1,7 @@ import yaml import json import fake_archive -from .. import report +from teuthology import report class TestSerializer(object): diff --git a/teuthology/test/test_results.py b/teuthology/test/test_results.py index 78022d7f94..421a64d8de 100644 --- a/teuthology/test/test_results.py +++ b/teuthology/test/test_results.py @@ -1,7 +1,6 @@ import textwrap -from ..config import config -from .. import results - +from teuthology.config import config +from teuthology import results from teuthology import report from mock import patch, DEFAULT diff --git a/teuthology/test/test_safepath.py b/teuthology/test/test_safepath.py index e842e5a30c..afc81cdad3 100644 --- a/teuthology/test/test_safepath.py +++ b/teuthology/test/test_safepath.py @@ -1,4 +1,4 @@ -from .. import safepath +from teuthology import safepath class TestSafepath(object): def test_simple(self): diff --git a/teuthology/test/test_schedule.py b/teuthology/test/test_schedule.py index 4c52eed768..dd0a68f845 100644 --- a/teuthology/test/test_schedule.py +++ b/teuthology/test/test_schedule.py @@ -1,5 +1,5 @@ -from ..schedule import build_config -from ..misc import get_user +from teuthology.schedule import build_config +from teuthology.misc import get_user class TestSchedule(object): diff --git a/teuthology/test/test_vps_os_vers_parameter_checking.py b/teuthology/test/test_vps_os_vers_parameter_checking.py index 3bcda1f87b..73b6029dff 100644 --- a/teuthology/test/test_vps_os_vers_parameter_checking.py +++ b/teuthology/test/test_vps_os_vers_parameter_checking.py @@ -1,7 +1,7 @@ from mock import patch, Mock import teuthology.lock.util -from .. import provision +from teuthology import provision class TestVpsOsVersionParamCheck(object): diff --git a/teuthology/test/test_worker.py b/teuthology/test/test_worker.py index 575dfe3164..7a909bae78 100644 --- a/teuthology/test/test_worker.py +++ b/teuthology/test/test_worker.py @@ -5,9 +5,9 @@ import subprocess from mock import patch, Mock, MagicMock from datetime import datetime, timedelta -from .. import worker +from teuthology import worker -from ..contextutil import MaxWhileTries +from teuthology.contextutil import MaxWhileTries class TestWorker(object): diff --git a/teuthology/worker.py b/teuthology/worker.py index 8e061c66f3..59f094320a 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -9,14 +9,14 @@ import yaml from datetime import datetime from teuthology import setup_log_file, install_except_hook -from . import beanstalk -from . import report -from . import safepath -from .config import config as teuth_config -from .config import set_config_attr -from .exceptions import BranchNotFoundError, SkipJob, MaxWhileTries -from .kill import kill_job -from .repo_utils import fetch_qa_suite, fetch_teuthology +from teuthology import beanstalk +from teuthology import report +from teuthology import safepath +from teuthology.config import config as teuth_config +from teuthology.config import set_config_attr +from teuthology.exceptions import BranchNotFoundError, SkipJob, MaxWhileTries +from teuthology.kill import kill_job +from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology log = logging.getLogger(__name__) start_time = datetime.utcnow()