From: Sage Weil Date: Fri, 30 Aug 2013 03:27:40 +0000 (-0700) Subject: run: do not import at top level X-Git-Tag: 1.1.0~1919 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f342baeb229b00914979cb923a7f2dab9197bc18;p=teuthology.git 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 --- diff --git a/teuthology/run.py b/teuthology/run.py index 30eb521ee..840799b8d 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)