From e96bc981ce6fdb8883c2f9f2a670d8342f015c7d Mon Sep 17 00:00:00 2001 From: Dimos Alevizos Date: Fri, 17 May 2013 13:36:40 +0300 Subject: [PATCH] Set paramiko's logging level Excplicity set paramiko's logging level to WARNING. By default it inherits ansible's DEBUG logging level (set in callbacks.py) and fills the log file with useless debug messages. Obviously it only applies if log_path is set in ansible.cfg --- lib/ansible/runner/connection_plugins/paramiko_ssh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/runner/connection_plugins/paramiko_ssh.py b/lib/ansible/runner/connection_plugins/paramiko_ssh.py index c8e62ee480..b5ad86156a 100644 --- a/lib/ansible/runner/connection_plugins/paramiko_ssh.py +++ b/lib/ansible/runner/connection_plugins/paramiko_ssh.py @@ -20,6 +20,7 @@ import os import pipes import socket import random +import logging from ansible.callbacks import vvv from ansible import errors from ansible import utils @@ -31,6 +32,7 @@ with warnings.catch_warnings(): try: import paramiko HAVE_PARAMIKO=True + logging.getLogger("paramiko").setLevel(logging.WARNING) except ImportError: pass