From d863242538703dc97d4d59eda28ee613dd0e9e77 Mon Sep 17 00:00:00 2001 From: Clayton O'Neill Date: Thu, 5 Nov 2015 15:40:27 -0500 Subject: [PATCH] Add Errno::ENETUNREACH to SSH rescue This changes the ssh ready? method to treat ENETUNREACH the same way as EHOSTUNREACH errors. When attempting to SSH into a box, it tries up to 5 times to connect to the box, ignoring various errors. Later it will catch and gracefully handle most of those errors so that callers don't have to know the details. However, the Errno::ENETUNREACH error is not caught, which means that callers that expect a clean boolean return from ready? don't get that, and instead get an exception they probably aren't expecting. --- plugins/communicators/ssh/communicator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 8297329f9..035ef5f61 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -420,7 +420,7 @@ module VagrantPlugins rescue Errno::EHOSTDOWN # This is raised if we get an ICMP DestinationUnknown error. raise Vagrant::Errors::SSHHostDown - rescue Errno::EHOSTUNREACH + rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH # This is raised if we can't work out how to route traffic. raise Vagrant::Errors::SSHNoRoute rescue Net::SSH::Exception => e