public
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
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
jamis (author)
Thu May 10 20:45:16 -0700 2007
commit  578c28cf3ff8a8c9a802325ea90c687e6ac8bf4a
tree    e75a702d4327cec58fe2fd7e81308927eab11c07
parent  ac954531f90a656865993e47963d9e3f7388ac6b
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Don't retry failed connections if an explicit auth_methods list is given [Chris Farms]
0
+
0
 * 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]
0
 
0
 * Added support for start and finish callbacks, which get invoked when any task is called via the command-line [Jamis Buck]
...
52
53
54
55
 
56
57
58
...
52
53
54
 
55
56
57
58
0
@@ -52,7 +52,7 @@ module Capistrano
0
         Server.apply_to(connection, server)
0
 
0
       rescue Net::SSH::AuthenticationFailed
0
- raise if methods.empty?
0
+ raise if methods.empty? || options[:ssh_options] && options[:ssh_options][:auth_methods]
0
         password_value = options[:password]
0
         retry
0
       end
...
83
84
85
 
 
 
 
 
86
...
83
84
85
86
87
88
89
90
91
0
@@ -83,4 +83,9 @@ class SSHTest < Test::Unit::TestCase
0
     assert success.respond_to?(:xserver)
0
     assert_equal success.xserver, @server
0
   end
0
+
0
+ def test_connect_should_not_retry_if_custom_auth_methods_are_given
0
+ Net::SSH.expects(:start).with(@server.host, @options.merge(:auth_methods => %w(publickey))).raises(Net::SSH::AuthenticationFailed)
0
+ assert_raises(Net::SSH::AuthenticationFailed) { Capistrano::SSH.connect(@server, :ssh_options => { :auth_methods => %w(publickey) }) }
0
+ end
0
 end

Comments

    No one has commented yet.