make sure to break out of key auth loop on success when doing 2-factor

(cherry picked from commit 0a4aa8a9d119022adef3b8d89f129ea26110fc1a)
This commit is contained in:
Andrew 2012-08-02 13:03:14 -07:00 committed by Jeff Forcier
parent 33176b90f7
commit b592eb1074
1 changed files with 2 additions and 0 deletions

View File

@ -455,6 +455,7 @@ class SSHClient (object):
if not remaining_auth_types: if not remaining_auth_types:
return return
two_factor = True two_factor = True
break
except SSHException, e: except SSHException, e:
saved_exception = e saved_exception = e
else: else:
@ -485,6 +486,7 @@ class SSHClient (object):
if not remaining_auth_types: if not remaining_auth_types:
return return
two_factor = True two_factor = True
break
except SSHException, e: except SSHException, e:
saved_exception = e saved_exception = e
except IOError, e: except IOError, e: