use_key function was catching paramiko.ssh_exception.SSHException before paramiko.ssh_exception.PasswordRequiredException. However, since SSHException is a superclass of PasswordRequiredException, this latter one was never catched, and so the password prompt was never displayed.
use_key
function was catchingparamiko.ssh_exception.SSHException
beforeparamiko.ssh_exception.PasswordRequiredException
. However, sinceSSHException
is a superclass ofPasswordRequiredException
, this latter one was never catched, and so the password prompt was never displayed.