From 566e21d3fc21b435e70c23798ae9ba4b0b7d816e Mon Sep 17 00:00:00 2001 From: Austin Schutz Date: Fri, 20 Jun 2014 13:15:24 -0700 Subject: [PATCH] add machine readable logging, action starts/ends --- lib/vagrant/machine.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 07ec0ac94..e70e99d6e 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -107,7 +107,8 @@ module Vagrant @provider_config = provider_config @provider_name = provider_name @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 # Read the ID, which is usually in local storage @@ -188,7 +189,10 @@ module Vagrant end # 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 rescue Errors::EnvironmentLockedError raise Errors::MachineActionLockedError,