Skip to content

Commit

Permalink
Propagate original Net::SSH::AuthenticationFailed exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mzahir committed Oct 2, 2013
1 parent e5cc6d3 commit 27feea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rye/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -681,14 +681,14 @@ def connect(reconnect=true)
# Raise Net::SSH::AuthenticationFailed if publickey is the
# only auth method
if @rye_opts[:auth_methods] == ["publickey"]
raise Net::SSH::AuthenticationFailed
raise ex
elsif @rye_password_prompt && (STDIN.tty? && retried <= 3)
STDERR.puts "Passwordless login failed for #{@rye_user}"
@rye_opts[:password] = highline.ask("Password: ") { |q| q.echo = '' }.strip
@rye_opts[:auth_methods].push *['keyboard-interactive', 'password']
retry
else
raise Net::SSH::AuthenticationFailed
raise ex
end
end

Expand Down

0 comments on commit 27feea1

Please sign in to comment.