diff --git a/lib/capistrano/configuration/connections.rb b/lib/capistrano/configuration/connections.rb index 5d087223..0b01d490 100644 --- a/lib/capistrano/configuration/connections.rb +++ b/lib/capistrano/configuration/connections.rb @@ -52,7 +52,7 @@ module Capistrano if exists?(:gateway) logger.debug "establishing connection to gateway `#{fetch(:gateway)}'" - Gateway.new(ServerDefinition.new(fetch(:gateway)), options) + Gateway.new(ServerDefinition.new(fetch(:gateway)), options.merge(:logger => logger)) else DefaultConnectionFactory.new(options) end diff --git a/lib/capistrano/gateway.rb b/lib/capistrano/gateway.rb index 3cf1f097..d6a01b7c 100644 --- a/lib/capistrano/gateway.rb +++ b/lib/capistrano/gateway.rb @@ -75,7 +75,7 @@ module Capistrano # Net::SSH connection via that port. def connect_to(server) connection = nil - logger.trace "establishing connection to #{server} via gateway" if logger + logger.trace "establishing connection to `#{server.host}' via gateway" if logger local_port = next_port thread = Thread.new do diff --git a/test/configuration/connections_test.rb b/test/configuration/connections_test.rb index 6b907aa3..0e3030ad 100644 --- a/test/configuration/connections_test.rb +++ b/test/configuration/connections_test.rb @@ -65,7 +65,7 @@ class ConfigurationConnectionsTest < Test::Unit::TestCase def test_connection_factory_as_gateway_should_honor_config_options @config.values[:gateway] = "capistrano" @config.values.update(@ssh_options) - Capistrano::SSH.expects(:connect).with { |s,opts| s.host == "capistrano" && opts == @ssh_options }.yields(stub_everything) + Capistrano::SSH.expects(:connect).with { |s,opts| s.host == "capistrano" && opts == @ssh_options.merge(:logger => @config.logger) }.yields(stub_everything) assert_instance_of Capistrano::Gateway, @config.connection_factory end