communicators/ssh: cleaner error if remote disconnect [GH-4038]

This commit is contained in:
Mitchell Hashimoto 2014-08-07 11:53:44 -07:00
parent a08d9078da
commit 5ed0b22c78
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,7 @@ BUG FIXES:
- core: Fix crash case when destroying with an invalid provisioner. [GH-4281] - core: Fix crash case when destroying with an invalid provisioner. [GH-4281]
- commands/package: base package won't crash with exception [GH-4017] - commands/package: base package won't crash with exception [GH-4017]
- commands/rsync-auto: Destroyed machines won't raise exceptions. [GH-4031] - commands/rsync-auto: Destroyed machines won't raise exceptions. [GH-4031]
- communicators/ssh: Nicer error if remote unexpectedly disconects. [GH-4038]
- communicators/winrm: Support `mkdir` [GH-4271] - communicators/winrm: Support `mkdir` [GH-4271]
- guests/centos: Fix issues when NFS client is installed by restarting - guests/centos: Fix issues when NFS client is installed by restarting
NFS [GH-4088] NFS [GH-4088]

View File

@ -517,8 +517,11 @@ module VagrantPlugins
begin begin
channel.wait channel.wait
rescue Errno::ECONNRESET, IOError rescue Errno::ECONNRESET, IOError
@logger.info("SSH connection unexpected closed. Assuming reboot or something.") @logger.info(
"SSH connection unexpected closed. Assuming reboot or something.")
exit_status = 0 exit_status = 0
rescue Net::SSH::Disconnect
raise Vagrant::Errors::SSHDisconnected
end end
ensure ensure
# Kill the keep-alive thread # Kill the keep-alive thread