From f160ab648740edf89a37bc8f926ce259d20ced24 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 4 Oct 2013 12:05:42 -0500 Subject: [PATCH] Move teuthology.report import; add large warning Because of the monkey patching, if we get the import order wrong bad things happen. Signed-off-by: Zack Cerza --- teuthology/run.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 767e131e2918f..65159540674bc 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -152,14 +152,19 @@ def main(): monkey.patch_all(dns=False) from .orchestra import monkey monkey.patch_all() - import logging - from . import report + # WARNING: Do not import any modules that import logging before this next + # block. That would cause connections to hang because the monkey patching + # hadn't been done. + import logging ctx = parse_args() set_up_logging(ctx) log = logging.getLogger(__name__) + # Now it is safe to import other teuthology modules. + from . import report + if ctx.owner is None: from teuthology.misc import get_user ctx.owner = get_user() -- 2.39.5