Only allow the ui to be overridden when running action
This commit is contained in:
parent
a1c2393e77
commit
7331623a39
@ -231,15 +231,18 @@ module Vagrant
|
|||||||
# @param [Proc] callable
|
# @param [Proc] callable
|
||||||
# @param [Hash] extra_env Extra env for the action env.
|
# @param [Hash] extra_env Extra env for the action env.
|
||||||
# @return [Hash] The resulting env
|
# @return [Hash] The resulting env
|
||||||
def action_raw(name, callable, extra_env=nil)
|
def action_raw(name, callable, extra_env={})
|
||||||
|
if !extra_env.is_a?(Hash)
|
||||||
|
extra_env = {}
|
||||||
|
end
|
||||||
|
|
||||||
# Run the action with the action runner on the environment
|
# Run the action with the action runner on the environment
|
||||||
env = {
|
env = {ui: @ui}.merge(extra_env).merge(
|
||||||
raw_action_name: name,
|
raw_action_name: name,
|
||||||
action_name: "machine_action_#{name}".to_sym,
|
action_name: "machine_action_#{name}".to_sym,
|
||||||
machine: self,
|
machine: self,
|
||||||
machine_action: name,
|
machine_action: name
|
||||||
ui: @ui,
|
)
|
||||||
}.merge(extra_env || {})
|
|
||||||
@env.action_runner.run(callable, env)
|
@env.action_runner.run(callable, env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user