Retry all SSH commands on Net::SSH::Disconnect

This commit is contained in:
Mitchell Hashimoto 2011-04-19 22:25:56 -07:00
parent 234c47a3a7
commit 6d669d70de
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
## 0.7.3 (unreleased)
- Retry all SSH on Net::SSH::Disconnect in case SSH is just restarting. [GH-313]
- Add NFS shared folder support for Arch linux. [GH-346]
- Fix issue with unknown terminal type output for sudo commands.
- Forwarded port protocol can now be set as UDP. [GH-311]

View File

@ -61,7 +61,7 @@ module Vagrant
# the actual `exec!` implementation, except that this
# implementation also reports `:exit_status` to the block if given.
def exec!(command, options=nil, &block)
retryable(:tries => 5, :on => IOError, :sleep => 0.5) do
retryable(:tries => 5, :on => [IOError, Net::SSH::Disconnect], :sleep => 1.0) do
metach = session.open_channel do |channel|
channel.exec(command) do |ch, success|
raise "could not execute command: #{command.inspect}" unless success