From acbd024fa2964c543624c79dc693a0b5c5397193 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 6 Feb 2013 16:23:35 -0800 Subject: [PATCH] Put the machine action in the middleware env --- lib/vagrant/action/builtin/provision.rb | 4 ++-- lib/vagrant/machine.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/action/builtin/provision.rb b/lib/vagrant/action/builtin/provision.rb index 42be025d7..a79a98bcb 100644 --- a/lib/vagrant/action/builtin/provision.rb +++ b/lib/vagrant/action/builtin/provision.rb @@ -50,7 +50,7 @@ module Vagrant next if env[:provision_types] && \ !env[:provision_types].include?(type_map[p]) - run_provisioner(p) + run_provisioner(env, p) end end end @@ -58,7 +58,7 @@ module Vagrant # This is pulled out into a seperate method so that users can # subclass and implement custom behavior if they'd like around # this step. - def run_provisioner(p) + def run_provisioner(env, p) env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning", :provisioner => p.class)) diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index b5e2800e0..f6bad1e42 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -121,8 +121,9 @@ module Vagrant # Run the action with the action runner on the environment env = { - :machine => self, - :ui => @env.ui_class.new(@name) + :machine => self, + :machine_action => name, + :ui => @env.ui_class.new(@name) }.merge(extra_env || {}) @env.action_runner.run(callable, env) end