More logging in SSH class

This commit is contained in:
Mitchell Hashimoto 2011-12-11 16:37:33 -08:00
parent e5c2f38d7c
commit 48f0a50e61
1 changed files with 5 additions and 1 deletions

View File

@ -117,6 +117,8 @@ module Vagrant
# #
# @return [Boolean] # @return [Boolean]
def up? def up?
@logger.debug("Checking whether SSH is up")
# We have to determine the port outside of the block since it uses # We have to determine the port outside of the block since it uses
# API calls which can only be used from the main thread in JRuby on # API calls which can only be used from the main thread in JRuby on
# Windows # Windows
@ -127,11 +129,13 @@ module Vagrant
execute(:timeout => @vm.config.ssh.timeout, :port => ssh_port) { |ssh| } execute(:timeout => @vm.config.ssh.timeout, :port => ssh_port) { |ssh| }
end end
@logger.info("SSH is up!")
true true
rescue Net::SSH::AuthenticationFailed rescue Net::SSH::AuthenticationFailed
raise Errors::SSHAuthenticationFailed raise Errors::SSHAuthenticationFailed
rescue Timeout::Error, Errno::ECONNREFUSED, Net::SSH::Disconnect, rescue Timeout::Error, Errno::ECONNREFUSED, Net::SSH::Disconnect,
Errors::SSHConnectionRefused Errors::SSHConnectionRefused => e
@logger.info("SSH not up: #{e.inspect}")
return false return false
end end