From cdf1d7f3182b76e2a36e60234b09a24977179b83 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 6 Feb 2014 20:22:15 -0800 Subject: [PATCH] core: get rid of all uses of config_global --- plugins/commands/box/command/repackage.rb | 2 +- plugins/commands/package/command.rb | 2 +- .../virtualbox/action/prepare_nfs_valid_ids_test.rb | 2 +- test/unit/vagrant/environment_test.rb | 6 +++--- test/unit/vagrant/machine_test.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/commands/box/command/repackage.rb b/plugins/commands/box/command/repackage.rb index fa986119a..ffff2b0ff 100644 --- a/plugins/commands/box/command/repackage.rb +++ b/plugins/commands/box/command/repackage.rb @@ -31,7 +31,7 @@ module VagrantPlugins raise Vagrant::Errors::BoxNotFound, :name => box_name, :provider => box_provider if !box # Repackage the box - output_name = @env.config_global.package.name || "package.box" + output_name = @env.vagrantfile.config.package.name || "package.box" output_path = Pathname.new(File.expand_path(output_name, FileUtils.pwd)) box.repackage(output_path) diff --git a/plugins/commands/package/command.rb b/plugins/commands/package/command.rb index 255c6f95e..36e3f8cca 100644 --- a/plugins/commands/package/command.rb +++ b/plugins/commands/package/command.rb @@ -59,7 +59,7 @@ module VagrantPlugins vm = Vagrant::Machine.new( options[:base], :virtualbox, provider[0], nil, provider[1], - @env.config_global, + @env.vagrantfile.config, nil, nil, @env, true) @logger.debug("Packaging base VM: #{vm.name}") diff --git a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb index 374f07132..bd617381b 100644 --- a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb +++ b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb @@ -15,7 +15,7 @@ describe VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSValidIds do provider_cls, provider_config, provider_options, - environment.config_global, + environment.vagrantfile.config, Pathname('data_dir'), double('box'), environment diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index 2e7758dcd..4478b5abf 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -833,7 +833,7 @@ VF end env = environment.create_vagrant_env - env.config_global.ssh.port.should == 200 + env.vagrantfile.config.ssh.port.should == 200 end it "should load from a custom Vagrantfile" do @@ -846,7 +846,7 @@ VF end env = environment.create_vagrant_env(:vagrantfile_name => "non_standard_name") - env.config_global.ssh.port.should == 200 + env.vagrantfile.config.ssh.port.should == 200 end it "should load from a custom Vagrantfile specified by env var" do @@ -862,7 +862,7 @@ VF environment.create_vagrant_env end - env.config_global.ssh.port.should == 400 + env.vagrantfile.config.ssh.port.should == 400 end end diff --git a/test/unit/vagrant/machine_test.rb b/test/unit/vagrant/machine_test.rb index 0be5455be..bcb3f8a0c 100644 --- a/test/unit/vagrant/machine_test.rb +++ b/test/unit/vagrant/machine_test.rb @@ -21,7 +21,7 @@ describe Vagrant::Machine do let(:provider_name) { :test } let(:provider_options) { {} } let(:box) { Object.new } - let(:config) { env.config_global } + let(:config) { env.vagrantfile.config } let(:data_dir) { Pathname.new(Dir.mktmpdir("vagrant")) } let(:env) do # We need to create a Vagrantfile so that this test environment