]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
run: do not import at top level
authorSage Weil <sage@inktank.com>
Fri, 30 Aug 2013 03:27:40 +0000 (20:27 -0700)
committerSage Weil <sage@inktank.com>
Fri, 30 Aug 2013 03:27:40 +0000 (20:27 -0700)
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
 <hangs>

No clue what is going on here, but this fixes it!

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/run.py

index 30eb521eedc74d65e1c7021a489bff9fc5f0f55a..840799b8d39424a14d55640c5335e97ebc9a3dd6 100644 (file)
@@ -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)