From 5a4c06f75e2fc727a17152a959a7a64992049137 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 29 Aug 2013 16:41:36 -0700 Subject: [PATCH] core: config.ssh.timeout => config.vm.boot_timeout --- CHANGELOG.md | 2 +- config/default.rb | 2 +- lib/vagrant/action/builtin/wait_for_communicator.rb | 2 +- plugins/kernel_v2/config/ssh.rb | 8 -------- plugins/kernel_v2/config/vm.rb | 3 +++ 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4999c037..20fe22ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ BACKWARDS INCOMPATIBILITY: - `config.ssh.max_tries` is gone. Instead of maximum tries, Vagrant now - uses a simple overall timeout value `config.ssh.timeout` to wait for + uses a simple overall timeout value `config.vm.boot_timeout` to wait for the machine to boot up. - `config.vm.graceful_halt_retry_*` settings are gone. Instead, a single timeout is now used to wait for a graceful halt to work, specified diff --git a/config/default.rb b/config/default.rb index 13d8ea1e8..06d07d30e 100644 --- a/config/default.rb +++ b/config/default.rb @@ -5,7 +5,6 @@ Vagrant.configure("2") do |config| config.ssh.forward_x11 = false config.ssh.guest_port = 22 config.ssh.keep_alive = true - config.ssh.timeout = 300 config.ssh.shell = "bash -l" config.ssh.default.username = "vagrant" @@ -13,6 +12,7 @@ Vagrant.configure("2") do |config| config.vm.usable_port_range = (2200..2250) config.vm.box_url = nil config.vm.base_mac = nil + config.vm.boot_timeout = 300 config.vm.graceful_halt_timeout = 60 # Share SSH locally by default diff --git a/lib/vagrant/action/builtin/wait_for_communicator.rb b/lib/vagrant/action/builtin/wait_for_communicator.rb index 462a39b1b..813905d4c 100644 --- a/lib/vagrant/action/builtin/wait_for_communicator.rb +++ b/lib/vagrant/action/builtin/wait_for_communicator.rb @@ -14,7 +14,7 @@ module Vagrant # for interrupts. ready_thr = Thread.new do Thread.current[:result] = env[:machine].communicate.wait_for_ready( - env[:machine].config.ssh.timeout) + env[:machine].config.vm.boot_timeout) end # Start a thread that verifies the VM stays in a good state. diff --git a/plugins/kernel_v2/config/ssh.rb b/plugins/kernel_v2/config/ssh.rb index d6d5cdd84..6775cd4a3 100644 --- a/plugins/kernel_v2/config/ssh.rb +++ b/plugins/kernel_v2/config/ssh.rb @@ -10,7 +10,6 @@ module VagrantPlugins attr_accessor :guest_port attr_accessor :keep_alive attr_accessor :shell - attr_accessor :timeout attr_reader :default @@ -22,7 +21,6 @@ module VagrantPlugins @guest_port = UNSET_VALUE @keep_alive = UNSET_VALUE @shell = UNSET_VALUE - @timeout = UNSET_VALUE @default = SSHConnectConfig.new end @@ -42,7 +40,6 @@ module VagrantPlugins @guest_port = nil if @guest_port == UNSET_VALUE @keep_alive = false if @keep_alive == UNSET_VALUE @shell = nil if @shell == UNSET_VALUE - @timeout = nil if @timeout == UNSET_VALUE @default.finalize! end @@ -54,11 +51,6 @@ module VagrantPlugins def validate(machine) errors = super - [:timeout].each do |field| - value = instance_variable_get("@#{field}".to_sym) - errors << I18n.t("vagrant.config.common.error_empty", :field => field) if !value - end - # Return the errors result = { to_s => errors } diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 019169303..89978cd39 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -15,6 +15,7 @@ module VagrantPlugins DEFAULT_VM_NAME = :default attr_accessor :base_mac + attr_accessor :boot_timeout attr_accessor :box attr_accessor :box_url attr_accessor :box_download_insecure @@ -25,6 +26,7 @@ module VagrantPlugins attr_reader :provisioners def initialize + @boot_timeout = UNSET_VALUE @box_download_insecure = UNSET_VALUE @graceful_halt_timeout = UNSET_VALUE @guest = UNSET_VALUE @@ -244,6 +246,7 @@ module VagrantPlugins def finalize! # Defaults + @boot_timeout = 300 if @boot_timeout == UNSET_VALUE @box_download_insecure = false if @box_download_insecure == UNSET_VALUE @graceful_halt_timeout = 300 if @graceful_halt_timeout == UNSET_VALUE @guest = nil if @guest == UNSET_VALUE