From c22e4fe19b775a03b71ac807f0441175ba6685e8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 14 Mar 2013 12:51:16 -0700 Subject: [PATCH] When there is no route to host for SSH, re-establish a new connection --- CHANGELOG.md | 1 + plugins/communicators/ssh/communicator.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7583301a6..6a26f39e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ BUG FIXES: - Quote keys to StringBlockEditor so keys with spaces, parens, and so on work properly. + - When there is no route to host for SSH, re-establish a new connection. ## 1.1.0 (March 14, 2013) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index fbc22c05e..bb9dc7792 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -126,6 +126,9 @@ module VagrantPlugins # socket. begin @connection.exec!("") + rescue Errno::EHOSTUNREACH + @logger.info("No route to host for connection. Not re-using.") + @connection = nil rescue IOError @logger.info("Connection has been closed. Not re-using.") @connection = nil