Load sub-VM configuration on first-pass, allowing box loading for sub-VMs. [closes GH-166] [closes GH-181]
This commit is contained in:
parent
48e5f4fb86
commit
c6b0fae318
|
@ -1,5 +1,7 @@
|
||||||
## 0.6.5 (unreleased)
|
## 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
|
- Configuration now only validates on final Vagrantfile proc, so multi-VM
|
||||||
validates correctly.
|
validates correctly.
|
||||||
- A nice error message is given if ".vagrant" is a directory and therefore
|
- A nice error message is given if ".vagrant" is a directory and therefore
|
||||||
|
|
|
@ -306,7 +306,7 @@ module Vagrant
|
||||||
|
|
||||||
# If this environment is representing a sub-VM, then we push that
|
# If this environment is representing a sub-VM, then we push that
|
||||||
# proc on as the last configuration.
|
# proc on as the last configuration.
|
||||||
if !first_run && vm
|
if vm
|
||||||
subvm = parent.config.vm.defined_vms[vm.name]
|
subvm = parent.config.vm.defined_vms[vm.name]
|
||||||
loader.queue << subvm.proc_stack if subvm
|
loader.queue << subvm.proc_stack if subvm
|
||||||
end
|
end
|
||||||
|
|
|
@ -365,7 +365,10 @@ class EnvironmentTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_box_vagrantfile
|
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
|
end
|
||||||
|
|
||||||
def create_home_vagrantfile
|
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
|
should "load from a sub-vm configuration if environment represents a VM" do
|
||||||
create_home_vagrantfile
|
create_home_vagrantfile
|
||||||
|
create_box_vagrantfile
|
||||||
vagrantfile(@env.root_path, <<-vf)
|
vagrantfile(@env.root_path, <<-vf)
|
||||||
config.package.name = "root.box"
|
config.package.name = "root.box"
|
||||||
config.vm.define :web do |web|
|
config.vm.define :web do |web|
|
||||||
|
web.vm.box = "box"
|
||||||
web.package.name = "web.box"
|
web.package.name = "web.box"
|
||||||
end
|
end
|
||||||
vf
|
vf
|
||||||
|
|
||||||
assert_equal "root.box", @env.config.package.name
|
assert_equal "root.box", @env.config.package.name
|
||||||
assert_equal "web.box", @env.vms[:web].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
|
end
|
||||||
|
|
||||||
should "reload the logger after executing" do
|
should "reload the logger after executing" do
|
||||||
|
|
Loading…
Reference in New Issue