add machine readable logging, action starts/ends

This commit is contained in:
Austin Schutz 2014-06-20 13:15:24 -07:00 committed by Mitchell Hashimoto
parent edffb130c3
commit 566e21d3fc
1 changed files with 6 additions and 2 deletions

View File

@ -107,7 +107,8 @@ module Vagrant
@provider_config = provider_config @provider_config = provider_config
@provider_name = provider_name @provider_name = provider_name
@provider_options = provider_options @provider_options = provider_options
@ui = Vagrant::UI::Prefixed.new(@env.ui, @name) @ui = @env.ui.is_a?(Vagrant::UI::MachineReadable) ? @env.ui.clone : Vagrant::UI::Prefixed.new(@env.ui, @name)
@ui.opts[:target] = name
@ui_mutex = Mutex.new @ui_mutex = Mutex.new
# Read the ID, which is usually in local storage # Read the ID, which is usually in local storage
@ -188,7 +189,10 @@ module Vagrant
end end
# Call the action # Call the action
action_raw(name, callable, extra_env) ui.machine("action", name.to_s, "start")
action_result = action_raw(name, callable, extra_env)
ui.machine("action", name.to_s, "end")
action_result
end end
rescue Errors::EnvironmentLockedError rescue Errors::EnvironmentLockedError
raise Errors::MachineActionLockedError, raise Errors::MachineActionLockedError,