Makes the execute method honor max_tries.

Vagrant::SSH.execute is hard coded for only 5 tries, this makes
  starting Debian machines very unreliable.  Debian will reset
  networking when you create a new hostonly NIC or change the hostname
  of the machine and occasionally the coming up part takes longer than
  what is provided by 5 tries.  Making this method honor the max_tries
  config option will make it possible to avoid this.
This commit is contained in:
Cody Herriges 2011-09-21 13:27:23 -07:00
parent 1bcbaa6df2
commit 48f3ce5880
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ module Vagrant
exceptions = [Errno::ECONNREFUSED, Net::SSH::Disconnect]
# Connect to SSH and gather the session
session = retryable(:tries => 5, :on => exceptions) do
session = retryable(:tries => env.config.ssh.max_tries, :on => exceptions) do
connection = Net::SSH.start(env.config.ssh.host,
env.config.ssh.username,
opts.merge( :keys => [env.config.ssh.private_key_path],