From 4f10387688d61d9f905a21cff7dec32926a82e6c Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Tue, 12 May 2020 17:29:41 +0100 Subject: [PATCH] utils/ssh: Only attempt loading ssh keys if no password is supplied In the case of connecting to a system without a password the password parameter needs to be set to an empty string which will currently still cause ssh keys to be loaded. Only check for ssh keys when the password is explicitly set to `None`. --- devlib/utils/ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py index 6ecd131..24c1c2e 100644 --- a/devlib/utils/ssh.py +++ b/devlib/utils/ssh.py @@ -351,7 +351,7 @@ class SshConnection(SshConnectionBase): else: policy = AutoAddPolicy # Only try using SSH keys if we're not using a password - check_ssh_keys = not self.password + check_ssh_keys = self.password is None with _handle_paramiko_exceptions(): client = SSHClient()