Fix some issues to get hooks working
This commit is contained in:
parent
b20dcc9eb8
commit
352fec0359
|
@ -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
|
||||
|
|
|
@ -18,11 +18,13 @@ module Vagrant
|
|||
#
|
||||
# @return [Array]
|
||||
def action_hooks
|
||||
[].tap do |result|
|
||||
result = []
|
||||
|
||||
@registered.each do |plugin|
|
||||
result += plugin.components.action_hooks
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
# This returns all the registered commands.
|
||||
|
|
Loading…
Reference in New Issue