Fix bug with loading Vagrantfiles with new case changing

This commit is contained in:
Mitchell Hashimoto 2011-07-10 16:08:39 -07:00
parent 11dc005d75
commit 8248679fab
3 changed files with 22 additions and 8 deletions

View File

@ -295,6 +295,8 @@ module Vagrant
output = nil
if ENV["VAGRANT_LOG"] == "STDOUT"
output = STDOUT
elsif ENV["VAGRANT_LOG"] == "NULL"
output = nil
elsif ENV["VAGRANT_LOG"]
output = ENV["VAGRANT_LOG"]
else
@ -431,9 +433,23 @@ module Vagrant
@config_loader.set(:default, File.expand_path("config/default.rb", Vagrant.source_root))
vagrantfile_name.each do |rootfile|
@config_loader.set(:box, File.join(box.directory, rootfile)) if !first_run && vm && box
@config_loader.set(:home, File.join(home_path, rootfile)) if !first_run && home_path
@config_loader.set(:root, File.join(root_path, rootfile)) if root_path
if !first_run && vm && box
# We load the box Vagrantfile
box_vagrantfile = box.directory.join(rootfile)
@config_loader.set(:box, box_vagrantfile) if box_vagrantfile.exist?
end
if !first_run && home_path
# Load the home Vagrantfile
home_vagrantfile = home_path.join(rootfile)
@config_loader.set(:home, home_vagrantfile) if home_vagrantfile.exist?
end
if root_path
# Load the Vagrantfile in this directory
root_vagrantfile = root_path.join(rootfile)
@config_loader.set(:root, File.join(root_path, rootfile)) if root_vagrantfile.exist?
end
end
# If this environment is representing a sub-VM, then we push that

View File

@ -16,6 +16,9 @@ end
# Set the home directory to some temporary directory
ENV["HOME"] = Vagrant.source_root.join("test", "tmp", "home").to_s
# Set the log output to nothing
ENV["VAGRANT_LOG"] = "NULL"
# Add the I18n locale for tests
I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)

View File

@ -525,11 +525,6 @@ class EnvironmentTest < Test::Unit::TestCase
assert_equal "set", @env.vms[:web].env.config.vm.base_mac
end
should "reload the logger after executing" do
@env.load_config!
assert @env.instance_variable_get(:@logger).nil?
end
should "be able to reload config" do
vagrantfile(@env.root_path, "config.vm.box = 'box'")