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]
def up?
@logger.debug("Checking whether SSH is up")
# 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
# Windows
@ -127,11 +129,13 @@ module Vagrant
execute(:timeout => @vm.config.ssh.timeout, :port => ssh_port) { |ssh| }
end
@logger.info("SSH is up!")
true
rescue Net::SSH::AuthenticationFailed
raise Errors::SSHAuthenticationFailed
rescue Timeout::Error, Errno::ECONNREFUSED, Net::SSH::Disconnect,
Errors::SSHConnectionRefused
Errors::SSHConnectionRefused => e
@logger.info("SSH not up: #{e.inspect}")
return false
end