Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6547: allow_multiple_ssh_ports_in_capistrano.diff

File allow_multiple_ssh_ports_in_capistrano.diff, 0.7 kB (added by ezmobius, 2 years ago)

allow multiple ssh ports in capistyrano deploy.rb files

  • lib/capistrano/ssh.rb

    old new  
    2727                        :password => password_value, 
    2828                        :port => port, 
    2929                        :auth_methods => methods.shift }.merge(config.ssh_options) 
    30         Net::SSH.start(server,ssh_options,&block) 
     30        Net::SSH.start((server.gsub(/:(\d+)$/,'') || server), 
     31                       ($1 ? ssh_options.merge({:port=>$1}) : ssh_options), 
     32                       &block) 
    3133      rescue Net::SSH::AuthenticationFailed 
    3234        raise if methods.empty? 
    3335        password_value = config.password