1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Don't retry failed connections if an explicit auth_methods list is given (closes #7961)

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-05-11 03:45:16 +00:00
parent 8d98302a40
commit 979282fba9
3 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Don't retry failed connections if an explicit auth_methods list is given [Chris Farms]
* Added support for load and exit callbacks, which get invoked when all recipes have been loaded and when all requested tasks have been executed [Jamis Buck]
* Added support for start and finish callbacks, which get invoked when any task is called via the command-line [Jamis Buck]

View file

@ -52,7 +52,7 @@ module Capistrano
Server.apply_to(connection, server)
rescue Net::SSH::AuthenticationFailed
raise if methods.empty?
raise if methods.empty? || options[:ssh_options] && options[:ssh_options][:auth_methods]
password_value = options[:password]
retry
end

View file

@ -83,4 +83,9 @@ class SSHTest < Test::Unit::TestCase
assert success.respond_to?(:xserver)
assert_equal success.xserver, @server
end
def test_connect_should_not_retry_if_custom_auth_methods_are_given
Net::SSH.expects(:start).with(@server.host, @options.merge(:auth_methods => %w(publickey))).raises(Net::SSH::AuthenticationFailed)
assert_raises(Net::SSH::AuthenticationFailed) { Capistrano::SSH.connect(@server, :ssh_options => { :auth_methods => %w(publickey) }) }
end
end