diff --git a/CHANGELOG.md b/CHANGELOG.md index 84e69bf21..1d23f8311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.5.2 (unreleased) + - Fix regression with `package` not working. [GH-132] - Added ability to specify box url in `init`, which populates the Vagrantfile with the proper `config.vm.box_url`. diff --git a/lib/vagrant/action/vm/package_vagrantfile.rb b/lib/vagrant/action/vm/package_vagrantfile.rb index 4bd1ce0d7..04b4489ed 100644 --- a/lib/vagrant/action/vm/package_vagrantfile.rb +++ b/lib/vagrant/action/vm/package_vagrantfile.rb @@ -21,7 +21,7 @@ module Vagrant # box. This Vagrantfile contains the MAC address so that the user doesn't # have to worry about it. def create_vagrantfile - File.open(File.join(@env["package.directory"], "Vagrantfile"), "w") do |f| + File.open(File.join(@env["export.temp_dir"], "Vagrantfile"), "w") do |f| f.write(TemplateRenderer.render("package_Vagrantfile", { :base_mac => @env["vm"].vm.network_adapters.first.mac_address })) diff --git a/test/vagrant/action/vm/package_vagrantfile_test.rb b/test/vagrant/action/vm/package_vagrantfile_test.rb index 96cfaf9ec..b35b59862 100644 --- a/test/vagrant/action/vm/package_vagrantfile_test.rb +++ b/test/vagrant/action/vm/package_vagrantfile_test.rb @@ -7,7 +7,7 @@ class PackageVagrantfileVMActionTest < Test::Unit::TestCase @vm = mock("vm") @env["vm"] = @vm - @env["package.directory"] = "foo" + @env["export.temp_dir"] = "foo" @internal_vm = mock("internal") @vm.stubs(:vm).returns(@internal_vm) @@ -34,7 +34,7 @@ class PackageVagrantfileVMActionTest < Test::Unit::TestCase should "write the rendered vagrantfile to temp_path Vagrantfile" do f = mock("file") rendered = mock("rendered") - File.expects(:open).with(File.join(@env["package.directory"], "Vagrantfile"), "w").yields(f) + File.expects(:open).with(File.join(@env["export.temp_dir"], "Vagrantfile"), "w").yields(f) Vagrant::Util::TemplateRenderer.expects(:render).returns(rendered).with("package_Vagrantfile", { :base_mac => @internal_vm.network_adapters.first.mac_address })