public
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
Search Repo:
fix connection problems when using gateways (closes #6913)


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@5832 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jamis (author)
Wed Jan 03 20:17:01 -0800 2007
commit  deb7977ff91783249e5c1def9058758050e8673c
tree    0579a783e21896c3641eeae6ebfaf7dde1208c27
parent  066b200068c08f966baab3ada7c98877205e7b70
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+*SVN*
0
+
0
+* Fix connection problems when using gateways [Ezra Zygmuntowicz]
0
+
0
 *1.3.0* (December 23, 2006)
0
 
0
 * Deprecate rake integration in favor of invoking `cap' directly [Jamis Buck]
...
21
22
23
 
 
24
25
26
 
27
28
 
29
30
31
32
33
34
35
36
...
40
41
42
43
 
44
45
46
...
21
22
23
24
25
26
27
 
28
29
 
30
31
 
 
 
 
32
33
34
...
38
39
40
 
41
42
43
44
0
@@ -21,16 +21,14 @@ module Capistrano
0
     def self.connect(server, config, port=22, &block)
0
       methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ]
0
       password_value = nil
0
+
0
+ user, server_stripped, pport = parse_server(server)
0
 
0
       begin
0
- ssh_options = { :username => config.user,
0
+ ssh_options = { :username => (user || config.user),
0
                         :password => password_value,
0
- :port => port,
0
+ :port => ((pport && pport != port) ? pport : port),
0
                         :auth_methods => methods.shift }.merge(config.ssh_options)
0
-
0
- user, server_stripped, port = parse_server(server)
0
- ssh_options[:username] = user if user
0
- ssh_options[:port] = port if port
0
         
0
         Net::SSH.start(server_stripped,ssh_options,&block)
0
       rescue Net::SSH::AuthenticationFailed
0
@@ -40,7 +38,7 @@ module Capistrano
0
       end
0
     end
0
     
0
- # This regex is used for its byproducts, the $1-9 match vars.
0
+ # This regex is used for its byproducts, the $1-3 match vars.
0
     # This regex will always match the ssh hostname and if there
0
     # is a username or port they will be matched as well. This
0
     # allows us to set the username and ssh port right in the

Comments

    No one has commented yet.