diff --git a/lib/vagrant/action/runner.rb b/lib/vagrant/action/runner.rb index b2306e12a..7309a4010 100644 --- a/lib/vagrant/action/runner.rb +++ b/lib/vagrant/action/runner.rb @@ -1,5 +1,6 @@ require 'log4r' +require 'vagrant/action/hook' require 'vagrant/util/busy' # TODO: @@ -31,13 +32,13 @@ module Vagrant hooks = Vagrant.plugin("2").manager.action_hooks if !hooks.empty? @logger.info("Preparing hooks for middleware sequence...") - env[:action_hooks] = hooks.map do |hook_proc| + environment[:action_hooks] = hooks.map do |hook_proc| Hook.new.tap do |h| hook_proc.call(h) end end - @logger.info("#{env[:action_hooks].length} hooks defined.") + @logger.info("#{environment[:action_hooks].length} hooks defined.") end # Run the action chain in a busy block, marking the environment as diff --git a/lib/vagrant/plugin/v2/manager.rb b/lib/vagrant/plugin/v2/manager.rb index f8ae7c940..def073a45 100644 --- a/lib/vagrant/plugin/v2/manager.rb +++ b/lib/vagrant/plugin/v2/manager.rb @@ -18,11 +18,13 @@ module Vagrant # # @return [Array] def action_hooks - [].tap do |result| - @registered.each do |plugin| - result += plugin.components.action_hooks - end + result = [] + + @registered.each do |plugin| + result += plugin.components.action_hooks end + + result end # This returns all the registered commands.