Better detect SSh connections closing
This commit is contained in:
parent
361cc1ae40
commit
ed038c8c64
|
@ -1,5 +1,9 @@
|
||||||
## 1.1.5 (unreleased)
|
## 1.1.5 (unreleased)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
- More robust SSH connection close detection.
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
- Proper error message if invalid provisioner is used. [GH-1515]
|
- Proper error message if invalid provisioner is used. [GH-1515]
|
||||||
|
|
|
@ -126,15 +126,10 @@ module VagrantPlugins
|
||||||
# socket.
|
# socket.
|
||||||
begin
|
begin
|
||||||
@connection.exec!("")
|
@connection.exec!("")
|
||||||
rescue Errno::EHOSTUNREACH
|
rescue Exception => e
|
||||||
@logger.info("No route to host for connection. Not re-using.")
|
@logger.info("Connection errored, not re-using. Will reconnect.")
|
||||||
@connection = nil
|
@logger.debug(e.inspect)
|
||||||
rescue Net::SSH::Disconnect
|
@conncetion = nil
|
||||||
@logger.info("SSH disconnected. Not-reusing connection.")
|
|
||||||
@connection = nil
|
|
||||||
rescue IOError
|
|
||||||
@logger.info("Connection has been closed. Not re-using.")
|
|
||||||
@connection = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# If the @connection is still around, then it is valid,
|
# If the @connection is still around, then it is valid,
|
||||||
|
|
Loading…
Reference in New Issue