Skip to content

Commit

Permalink
use SSHClient.set_log_channel
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Apr 27, 2020
1 parent f7489f3 commit 5994499
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dvc/remote/ssh/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

try:
import paramiko

logging.getLogger("paramiko.transport").disabled = True
except ImportError:
paramiko = None

Expand Down Expand Up @@ -43,6 +41,14 @@ def __init__(self, host, *args, **kwargs):
self.timeout = kwargs.get("timeout", 1800)

self._ssh = paramiko.SSHClient()

# Explicitly disable paramiko logger. Due to how paramiko dynamically
# loads loggers, it is not disabled by DVC disable_other_loggers().
# See https://github.com/iterative/dvc/issues/3482
self._ssh.set_log_channel("dvc.paramiko")
logging.getLogger("dvc.paramiko").disabled = True
logging.getLogger("dvc.paramiko.sftp").disabled = True

self._ssh.load_system_host_keys()
self._ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

Expand Down

0 comments on commit 5994499

Please sign in to comment.