From d202016023309686ddce63f4bab13049d6642566 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 12 Jun 2015 14:26:36 -0700 Subject: [PATCH] Silence urllib3 logging whether it's bundled in requests or not Also, do it only in teuthology/__init__.py Signed-off-by: Dan Mick --- teuthology/__init__.py | 3 +++ teuthology/lock.py | 3 --- teuthology/report.py | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/teuthology/__init__.py b/teuthology/__init__.py index 8144418c87..d0bcfc0ab2 100644 --- a/teuthology/__init__.py +++ b/teuthology/__init__.py @@ -21,6 +21,9 @@ if os.path.split(exec_dir)[-1] == 'bin' and exec_dir not in os.environ['PATH']: # We don't need to see log entries for each connection opened logging.getLogger('requests.packages.urllib3.connectionpool').setLevel( logging.WARN) +# if requests doesn't bundle it, shut it up anyway +logging.getLogger('urllib3.connectionpool').setLevel( + logging.WARN) logging.basicConfig( level=logging.INFO, diff --git a/teuthology/lock.py b/teuthology/lock.py index 0d100981ad..9b5796669a 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -16,9 +16,6 @@ from .config import config from .lockstatus import get_status log = logging.getLogger(__name__) -# Don't need to see connection pool INFO messages -logging.getLogger("requests.packages.urllib3.connectionpool").setLevel( - logging.WARNING) is_vpm = lambda name: 'vpm' in name diff --git a/teuthology/report.py b/teuthology/report.py index 48fed5cab3..e56d1422f4 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -20,10 +20,6 @@ def init_logging(): :returns: a logger """ - # Don't need to see connection pool INFO messages - logging.getLogger("requests.packages.urllib3.connectionpool").setLevel( - logging.WARNING) - log = logging.getLogger(__name__) return log -- 2.39.5