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:
parent
8d98302a40
commit
979282fba9
3 changed files with 8 additions and 1 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue