core: Add support for plugins to hook into the environment load process before configurations are parsed
This commit is contained in:
parent
a92e03cf4c
commit
bbe7b3ffc5
|
@ -131,6 +131,10 @@ module Vagrant
|
|||
# Load the plugins
|
||||
load_plugins
|
||||
|
||||
# Call the hooks that does not require configurations to be loaded
|
||||
# by using a "clean" action runner
|
||||
hook(:environment_plugins_loaded, Action::Runner.new)
|
||||
|
||||
# Call the environment load hooks
|
||||
hook(:environment_load)
|
||||
end
|
||||
|
@ -268,10 +272,10 @@ module Vagrant
|
|||
# against the given name will be run in the context of this environment.
|
||||
#
|
||||
# @param [Symbol] name Name of the hook.
|
||||
def hook(name)
|
||||
def hook(name, runner = action_runner)
|
||||
@logger.info("Running hook: #{name}")
|
||||
callable = Action::Builder.new
|
||||
action_runner.run(
|
||||
runner.run(
|
||||
callable,
|
||||
:action_name => name,
|
||||
:env => self)
|
||||
|
|
Loading…
Reference in New Issue