Put the machine action in the middleware env

This commit is contained in:
Mitchell Hashimoto 2013-02-06 16:23:35 -08:00
parent 1df4891371
commit acbd024fa2
2 changed files with 5 additions and 4 deletions

View File

@ -50,7 +50,7 @@ module Vagrant
next if env[:provision_types] && \ next if env[:provision_types] && \
!env[:provision_types].include?(type_map[p]) !env[:provision_types].include?(type_map[p])
run_provisioner(p) run_provisioner(env, p)
end end
end end
end end
@ -58,7 +58,7 @@ module Vagrant
# This is pulled out into a seperate method so that users can # This is pulled out into a seperate method so that users can
# subclass and implement custom behavior if they'd like around # subclass and implement custom behavior if they'd like around
# this step. # this step.
def run_provisioner(p) def run_provisioner(env, p)
env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning", env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning",
:provisioner => p.class)) :provisioner => p.class))

View File

@ -121,8 +121,9 @@ module Vagrant
# Run the action with the action runner on the environment # Run the action with the action runner on the environment
env = { env = {
:machine => self, :machine => self,
:ui => @env.ui_class.new(@name) :machine_action => name,
:ui => @env.ui_class.new(@name)
}.merge(extra_env || {}) }.merge(extra_env || {})
@env.action_runner.run(callable, env) @env.action_runner.run(callable, env)
end end