providers/virtualbox: config to skip guest additions check

This commit is contained in:
Mitchell Hashimoto 2014-02-08 18:35:09 -08:00
parent 342fba8182
commit 8d3afa73d2
3 changed files with 23 additions and 0 deletions

View File

@ -1,12 +1,20 @@
require "log4r"
module VagrantPlugins
module ProviderVirtualBox
module Action
class CheckGuestAdditions
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant::plugins::virtualbox::check_guest_additions")
end
def call(env)
if !env[:machine].provider_config.check_guest_additions
@logger.info("Not checking guest additions because configuration")
return @app.call(env)
end
env[:ui].output(I18n.t("vagrant.virtualbox.checking_guest_additions"))
# Use the raw interface for now, while the virtualbox gem

View File

@ -8,6 +8,12 @@ module VagrantPlugins
# @return [Boolean]
attr_accessor :auto_nat_dns_proxy
# If true, will check if guest additions are installed and up to
# date. By default, this is true.
#
# @return [Boolean]
attr_accessor :check_guest_additions
# An array of customizations to make on the VM prior to booting it.
#
# @return [Array]
@ -39,6 +45,7 @@ module VagrantPlugins
def initialize
@auto_nat_dns_proxy = UNSET_VALUE
@check_guest_additions = UNSET_VALUE
@customizations = []
@destroy_unused_network_interfaces = UNSET_VALUE
@name = UNSET_VALUE
@ -98,6 +105,10 @@ module VagrantPlugins
# Default is to auto the DNS proxy
@auto_nat_dns_proxy = true if @auto_nat_dns_proxy == UNSET_VALUE
if @check_guest_additions == UNSET_VALUE
@check_guest_additions = true
end
if @destroy_unused_network_interfaces == UNSET_VALUE
@destroy_unused_network_interfaces = false
end

View File

@ -6,6 +6,10 @@ describe VagrantPlugins::ProviderVirtualBox::Config do
context "defaults" do
before { subject.finalize! }
its(:check_guest_additions) { should be_true }
its(:gui) { should be_false }
its(:name) { should be_nil }
it "should have one NAT adapter" do
expect(subject.network_adapters).to eql({
1 => [:nat, {}],