From 2fe2fe79ed87bb53d477e227e52ad60b86ed3cd9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 13 Feb 2014 21:04:41 -0800 Subject: [PATCH] communicators/ssh: properly allow errors through while waiting --- plugins/communicators/ssh/communicator.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index bca8c26f3..5a20d1cf0 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -53,6 +53,7 @@ module VagrantPlugins @machine.ui.detail("SSH auth method: #{ssh_auth_type}") while true + message = nil begin begin connect(retries: 1) @@ -75,9 +76,13 @@ module VagrantPlugins message = "Host appears down." rescue Errno::EHOSTUNREACH message = "Host unreachable." + rescue Vagrant::Errors::VagrantError => e + # Ignore it, SSH is not ready, some other error. end - @machine.ui.detail("Error: #{message} Retrying...") + if message + @machine.ui.detail("Error: #{message} Retrying...") + end end end rescue Timeout::Error