]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Move teuthology.report import; add large warning
authorZack Cerza <zack@cerza.org>
Fri, 4 Oct 2013 17:05:42 +0000 (12:05 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 4 Oct 2013 17:08:33 +0000 (12:08 -0500)
Because of the monkey patching, if we get the import order wrong bad
things happen.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/run.py

index 767e131e2918f284d721b2e81917c1e2f9cd496a..65159540674bc8c3176b7dff86a047cfa3f91b18 100644 (file)
@@ -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()