From b592eb1074bb158643bccfef45c2d47c0233f93f Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 2 Aug 2012 13:03:14 -0700 Subject: [PATCH] make sure to break out of key auth loop on success when doing 2-factor (cherry picked from commit 0a4aa8a9d119022adef3b8d89f129ea26110fc1a) --- paramiko/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paramiko/client.py b/paramiko/client.py index b10a786..a142c0e 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -455,6 +455,7 @@ class SSHClient (object): if not remaining_auth_types: return two_factor = True + break except SSHException, e: saved_exception = e else: @@ -485,6 +486,7 @@ class SSHClient (object): if not remaining_auth_types: return two_factor = True + break except SSHException, e: saved_exception = e except IOError, e: