Load sub-VM configuration on first-pass, allowing box loading for sub-VMs. [closes GH-166] [closes GH-181]

This commit is contained in:
Mitchell Hashimoto 2010-10-08 10:34:33 -07:00
parent 48e5f4fb86
commit c6b0fae318
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,7 @@
## 0.6.5 (unreleased)
- Properly load sub-VM configuration on first-pass of config loading. Solves
a LOT of problems with multi-VM. [GH-166] [GH-181]
- Configuration now only validates on final Vagrantfile proc, so multi-VM
validates correctly.
- A nice error message is given if ".vagrant" is a directory and therefore

View File

@ -306,7 +306,7 @@ module Vagrant
# If this environment is representing a sub-VM, then we push that
# proc on as the last configuration.
if !first_run && vm
if vm
subvm = parent.config.vm.defined_vms[vm.name]
loader.queue << subvm.proc_stack if subvm
end

View File

@ -365,7 +365,10 @@ class EnvironmentTest < Test::Unit::TestCase
end
def create_box_vagrantfile
vagrantfile(vagrant_box("box"), 'config.package.name = "box.box"')
vagrantfile(vagrant_box("box"), <<-FILE)
config.package.name = "box.box"
config.vm.base_mac = "set"
FILE
end
def create_home_vagrantfile
@ -400,15 +403,18 @@ class EnvironmentTest < Test::Unit::TestCase
should "load from a sub-vm configuration if environment represents a VM" do
create_home_vagrantfile
create_box_vagrantfile
vagrantfile(@env.root_path, <<-vf)
config.package.name = "root.box"
config.vm.define :web do |web|
web.vm.box = "box"
web.package.name = "web.box"
end
vf
assert_equal "root.box", @env.config.package.name
assert_equal "web.box", @env.vms[:web].env.config.package.name
assert_equal "set", @env.vms[:web].env.config.vm.base_mac
end
should "reload the logger after executing" do