public
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
Remove explicit SSH Port 22 to allow ssh configuration files to overwrite 
it.
Ben Lavender (author)
Wed Jun 18 07:19:52 -0700 2008
jamis (committer)
Mon Jun 23 08:28:27 -0700 2008
commit  babc48a04c799d21145f843080c57b91119fbae9
tree    ffd3e82005f23960218bb6174421624aa6e76fb4
parent  a6223b3939f0ef91c928f94502c806a68a011e74
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *unreleased*
0
 
0
+* Let Net::SSH manage the default SSH port selection [Ben Lavender]
0
+
0
 * Changed capture() helper to not raise an exception on error, but to warn instead [Jeff Forcier]
0
 
0
 
...
23
24
25
26
27
28
29
30
31
...
58
59
60
61
62
63
 
 
 
64
 
65
66
67
...
23
24
25
 
 
 
26
27
28
...
55
56
57
 
 
 
58
59
60
61
62
63
64
65
0
@@ -23,9 +23,6 @@ module Capistrano
0
       attr_accessor :xserver
0
     end
0
 
0
- # The default port for SSH.
0
- DEFAULT_PORT = 22
0
-
0
     # An abstraction to make it possible to connect to the server via public key
0
     # without prompting for the password. If the public key authentication fails
0
     # this will fall back to password authentication.
0
@@ -58,10 +55,11 @@ module Capistrano
0
       methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ]
0
       password_value = nil
0
 
0
- ssh_options = (server.options[:ssh_options] || {}).merge(options[:ssh_options] || {})
0
- user = server.user || options[:user] || ssh_options[:username] || ServerDefinition.default_user
0
- ssh_options[:port] = server.port || options[:port] || ssh_options[:port] || DEFAULT_PORT
0
+ ssh_options = (server.options[:ssh_options] || {}).merge(options[:ssh_options] || {})
0
+ user = server.user || options[:user] || ssh_options[:username] || ServerDefinition.default_user
0
+ port = server.port || options[:port] || ssh_options[:port]
0
 
0
+ ssh_options[:port] = port if port
0
       ssh_options.delete(:username)
0
 
0
       begin
...
60
61
62
63
 
64
65
66
...
324
325
326
327
328
 
...
60
61
62
 
63
64
65
66
...
324
325
326
 
327
328
0
@@ -60,7 +60,7 @@ class ConfigurationConnectionsTest < Test::Unit::TestCase
0
 
0
   def test_connection_factory_should_return_gateway_instance_if_gateway_variable_is_set
0
     @config.values[:gateway] = "j@capistrano"
0
- Net::SSH::Gateway.expects(:new).with("capistrano", "j", :port => 22, :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything)
0
+ Net::SSH::Gateway.expects(:new).with("capistrano", "j", :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything)
0
     assert_instance_of Capistrano::Configuration::Connections::GatewayConnectionFactory, @config.connection_factory
0
   end
0
 
0
@@ -324,4 +324,4 @@ class ConfigurationConnectionsTest < Test::Unit::TestCase
0
         :max_hosts => options[:max_hosts]
0
       )
0
     end
0
-end
0
\ No newline at end of file
0
+end
...
5
6
7
8
9
10
11
...
5
6
7
 
8
9
10
0
@@ -5,7 +5,6 @@ class SSHTest < Test::Unit::TestCase
0
   def setup
0
     Capistrano::ServerDefinition.stubs(:default_user).returns("default-user")
0
     @options = { :password => nil,
0
- :port => 22,
0
                  :auth_methods => %w(publickey hostbased) }
0
     @server = server("capistrano")
0
   end

Comments

    No one has commented yet.