Simplify config option to ignore box vagrantfile

This commit is contained in:
Brian Cain 2018-09-26 10:31:41 -07:00
parent a45e62cacd
commit 424f49b919
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
3 changed files with 9 additions and 5 deletions

View File

@ -195,7 +195,7 @@ module Vagrant
box = boxes.find(config.vm.box, box_formats, config.vm.box_version) box = boxes.find(config.vm.box, box_formats, config.vm.box_version)
if box if box
box_vagrantfile = find_vagrantfile(box.directory) box_vagrantfile = find_vagrantfile(box.directory)
if box_vagrantfile && !config.vm.box_ignore_box_vagrantfile if box_vagrantfile && !config.vm.ignore_box_vagrantfile
box_config_key = box_config_key =
"#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym "#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym
@loader.set(box_config_key, box_vagrantfile) @loader.set(box_config_key, box_vagrantfile)

View File

@ -22,7 +22,7 @@ module VagrantPlugins
attr_accessor :base_mac attr_accessor :base_mac
attr_accessor :boot_timeout attr_accessor :boot_timeout
attr_accessor :box attr_accessor :box
attr_accessor :box_ignore_box_vagrantfile attr_accessor :ignore_box_vagrantfile
attr_accessor :box_check_update attr_accessor :box_check_update
attr_accessor :box_url attr_accessor :box_url
attr_accessor :box_server_url attr_accessor :box_server_url
@ -52,7 +52,7 @@ module VagrantPlugins
@base_mac = UNSET_VALUE @base_mac = UNSET_VALUE
@boot_timeout = UNSET_VALUE @boot_timeout = UNSET_VALUE
@box = UNSET_VALUE @box = UNSET_VALUE
@box_ignore_box_vagrantfile = UNSET_VALUE @ignore_box_vagrantfile = UNSET_VALUE
@box_check_update = UNSET_VALUE @box_check_update = UNSET_VALUE
@box_download_ca_cert = UNSET_VALUE @box_download_ca_cert = UNSET_VALUE
@box_download_ca_path = UNSET_VALUE @box_download_ca_path = UNSET_VALUE
@ -379,8 +379,7 @@ module VagrantPlugins
@base_mac = nil if @base_mac == UNSET_VALUE @base_mac = nil if @base_mac == UNSET_VALUE
@boot_timeout = 300 if @boot_timeout == UNSET_VALUE @boot_timeout = 300 if @boot_timeout == UNSET_VALUE
@box = nil if @box == UNSET_VALUE @box = nil if @box == UNSET_VALUE
@ignore_box_vagrantfile = false if @ignore_box_vagrantfile == UNSET_VALUE
@box_ignore_box_vagrantfile = false if @box_ignore_box_vagrantfile == UNSET_VALUE
if @box_check_update == UNSET_VALUE if @box_check_update == UNSET_VALUE
@box_check_update = !present?(ENV["VAGRANT_BOX_UPDATE_CHECK_DISABLE"]) @box_check_update = !present?(ENV["VAGRANT_BOX_UPDATE_CHECK_DISABLE"])

View File

@ -138,6 +138,11 @@ on the guest with the configured hostname.
<hr> <hr>
`config.vm.ignore_box_vagrantfile` - If true, Vagrant will not load the the
settings found inside a boxes Vagrantfile, if present. Defaults to `false`.
<hr>
`config.vm.network` - Configures [networks](/docs/networking/) on `config.vm.network` - Configures [networks](/docs/networking/) on
the machine. Please see the networking page for more information. the machine. Please see the networking page for more information.