Skip to content

Commit

Permalink
remote.ssh: suppress paramiko logging (#3675)
Browse files Browse the repository at this point in the history
* remote.ssh: suppress paramiko logging

* use SSHClient.set_log_channel
  • Loading branch information
pmrowla authored Apr 29, 2020
1 parent 7edee84 commit 31fe778
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dvc/remote/ssh/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,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 31fe778

Please sign in to comment.