UI on Machine

This commit is contained in:
Mitchell Hashimoto 2013-04-08 12:38:15 -07:00
parent 4d3159ff7e
commit 376eb0b327
1 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,11 @@ module Vagrant
# @return [Hash] # @return [Hash]
attr_reader :provider_options attr_reader :provider_options
# The UI for outputting in the scope of this machine.
#
# @return [UI]
attr_reader :ui
# Initialize a new machine. # Initialize a new machine.
# #
# @param [String] name Name of the virtual machine. # @param [String] name Name of the virtual machine.
@ -91,6 +96,7 @@ 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 = @env.ui.scope(@name)
# Read the ID, which is usually in local storage # Read the ID, which is usually in local storage
@id = nil @id = nil
@ -136,7 +142,7 @@ module Vagrant
: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 => @env.ui.scope(@name) :ui => @ui
}.merge(extra_env || {}) }.merge(extra_env || {})
@env.action_runner.run(callable, env) @env.action_runner.run(callable, env)
end end