From f342baeb229b00914979cb923a7f2dab9197bc18 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 29 Aug 2013 20:27:40 -0700 Subject: [PATCH] run: do not import at top level This makes a run with --lock hang when connecting, for some reason. E.g., $ teuthology -v a.yaml --lock ... INFO:teuthology.task.internal:Opening connections... DEBUG:teuthology.task.internal:connecting to ubuntu@plana06.front.sepia.ceph.com No clue what is going on here, but this fixes it! Signed-off-by: Sage Weil --- teuthology/run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/teuthology/run.py b/teuthology/run.py index 30eb521eedc74..840799b8d3942 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -3,7 +3,6 @@ import os import yaml import StringIO import contextlib -import logging import sys from traceback import format_tb @@ -88,6 +87,8 @@ def parse_args(): def set_up_logging(ctx): + import logging + loglevel = logging.INFO if ctx.verbose: loglevel = logging.DEBUG @@ -111,6 +112,8 @@ def set_up_logging(ctx): def install_except_hook(): def log_exception(exception_class, exception, traceback): + import logging + logging.critical(''.join(format_tb(traceback))) if not exception.message: logging.critical(exception_class.__name__) @@ -146,6 +149,7 @@ def main(): monkey.patch_all(dns=False) from .orchestra import monkey monkey.patch_all() + import logging ctx = parse_args() set_up_logging(ctx) -- 2.39.5