diff --git a/lib/vagrant/actions/vm/provision.rb b/lib/vagrant/actions/vm/provision.rb index 89360203f..dea5760ca 100644 --- a/lib/vagrant/actions/vm/provision.rb +++ b/lib/vagrant/actions/vm/provision.rb @@ -19,7 +19,7 @@ module Vagrant end if provisioner.is_a?(Class) - @provisioner = provisioner.new(@runner.env) + @provisioner = provisioner.new(@runner) raise ActionException.new(:provisioner_invalid_class) unless @provisioner.is_a?(Provisioners::Base) elsif provisioner.is_a?(Symbol) # We have a few hard coded provisioners for built-ins @@ -30,7 +30,7 @@ module Vagrant provisioner_klass = mapping[provisioner] raise ActionException.new(:provisioner_unknown_type, :provisioner => provisioner.to_s) if provisioner_klass.nil? - @provisioner = provisioner_klass.new(@runner.env) + @provisioner = provisioner_klass.new(@runner) end logger.info "Provisioning enabled with #{@provisioner.class}" diff --git a/test/vagrant/actions/vm/provision_test.rb b/test/vagrant/actions/vm/provision_test.rb index 85f895334..2688c29f5 100644 --- a/test/vagrant/actions/vm/provision_test.rb +++ b/test/vagrant/actions/vm/provision_test.rb @@ -44,13 +44,13 @@ class ProvisionActionTest < Test::Unit::TestCase @instance.stubs(:prepare) @klass = mock("klass") @klass.stubs(:is_a?).with(Class).returns(true) - @klass.stubs(:new).with(@runner.env).returns(@instance) + @klass.stubs(:new).with(@runner).returns(@instance) @runner.env.config.vm.provisioner = @klass end should "set the provisioner to an instantiation of the class" do - @klass.expects(:new).with(@runner.env).once.returns(@instance) + @klass.expects(:new).with(@runner).once.returns(@instance) assert_nothing_raised { @action.prepare } assert_equal @instance, @action.provisioner end @@ -74,7 +74,7 @@ class ProvisionActionTest < Test::Unit::TestCase instance = mock("instance") instance.expects(:prepare).once - provisioner.expects(:new).with(@runner.env).returns(instance) + provisioner.expects(:new).with(@runner).returns(instance) assert_nothing_raised { @action.prepare } assert_equal instance, @action.provisioner end