import sys
from collections import OrderedDict
-import teuthology.report as report
-
+from teuthology import report
from teuthology.config import config
log = logging.getLogger(__name__)
from datetime import datetime
from typing import Dict, List
-import teuthology.dispatcher.supervisor as supervisor
-import teuthology.lock.ops as lock_ops
-import teuthology.nuke as nuke
-import teuthology.worker as worker
-
-from teuthology import setup_log_file, install_except_hook
-from teuthology import beanstalk
-from teuthology import report
+from teuthology import (
+ # non-modules
+ setup_log_file,
+ install_except_hook,
+ # modules
+ beanstalk,
+ nuke,
+ report,
+ worker,
+)
from teuthology.config import config as teuth_config
+from teuthology.dispatcher import supervisor
from teuthology.exceptions import SkipJob
+from teuthology.lock import ops as lock_ops
from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology
from teuthology import safepath
from urllib.parse import urljoin
from datetime import datetime
-import teuthology.lock.ops as lock_ops
-import teuthology.nuke as nuke
-
-from teuthology import report
-from teuthology import safepath
+from teuthology import kill, nuke, report, safepath
from teuthology.config import config as teuth_config
from teuthology.exceptions import SkipJob, MaxWhileTries
from teuthology import setup_log_file, install_except_hook
from teuthology.misc import get_user, archive_logs, compress_logs
from teuthology.config import FakeNamespace
from teuthology.job_status import get_status
-from teuthology.kill import kill_job
-from teuthology.task.internal import add_remotes
+from teuthology.lock import ops as lock_ops
+from teuthology.task import internal
from teuthology.misc import decanonicalize_hostname as shortname
from teuthology.lock import query
try:
# kill processes but do not nuke yet so we can save
# the logs, coredumps, etc.
- kill_job(job_info['name'], job_info['job_id'],
- teuth_config.archive_base, job_config['owner'],
- skip_nuke=True)
+ kill.kill_job(
+ job_info['name'], job_info['job_id'],
+ teuth_config.archive_base, job_config['owner'],
+ skip_nuke=True
+ )
except Exception:
log.exception('Failed to kill job')
try:
# this time remove everything and unlock the machines
- kill_job(job_info['name'], job_info['job_id'],
- teuth_config.archive_base, job_config['owner'])
+ kill.kill_job(
+ job_info['name'], job_info['job_id'],
+ teuth_config.archive_base, job_config['owner']
+ )
except Exception:
log.exception('Failed to kill job and unlock machines')
if 'archive' in job_info:
ctx = create_fake_context(job_config)
- add_remotes(ctx, job_config)
+ internal.add_remotes(ctx, job_config)
for log_type, log_path in job_info['archive'].items():
if log_type == 'init':
import teuthology.orchestra.remote
import teuthology.parallel
import teuthology.provision
-import teuthology.report as report
-from teuthology import misc
+from teuthology import misc, report
from teuthology.config import config
from teuthology.contextutil import safe_while
from teuthology.task import console_log
import yaml
import teuthology
-import teuthology.lock.ops as lock_ops
from teuthology import provision
+from teuthology.lock import ops as lock_ops
from teuthology.lock.query import is_vm, list_locks, \
find_stale_locks, get_status
from teuthology.lock.util import locked_since_seconds
from datetime import datetime
-from teuthology import setup_log_file, install_except_hook
+from teuthology import setup_log_file, install_except_hook, kill
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, CommitNotFoundError, SkipJob, MaxWhileTries
-from teuthology.kill import kill_job
from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology, ls_remote, build_git_url
log = logging.getLogger(__name__)
if total_seconds > teuth_config.max_job_time:
log.warning("Job ran longer than {max}s. Killing...".format(
max=teuth_config.max_job_time))
- kill_job(job_info['name'], job_info['job_id'],
+ kill.kill_job(job_info['name'], job_info['job_id'],
teuth_config.archive_base, job_config['owner'])
# calling this without a status just updates the jobs updated time