remote.ssh: suppress paramiko logging (#3675)

* remote.ssh: suppress paramiko logging

* use SSHClient.set_log_channel
This commit is contained in:
Peter Rowlands (변기호)
2020-04-29 18:17:53 +05:45
committed by GitHub
parent 7edee84306
commit 31fe77848f
+8
View File
@@ -41,6 +41,14 @@ class SSHConnection:
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())