diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index f54b0d018..552025a84 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -32,6 +32,9 @@ module Vagrant # The {UI} object to communicate with the outside world. attr_reader :ui + # This is the UI class to use when creating new UIs. + attr_reader :ui_class + # The directory to the "home" folder that Vagrant will use to store # global state. attr_reader :home_path @@ -92,6 +95,7 @@ module Vagrant @lock_path = opts[:lock_path] @vagrantfile_name = opts[:vagrantfile_name] @ui = opts[:ui_class].new + @ui_class = opts[:ui_class] @lock_acquired = false diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 2729edab6..b64df747b 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -120,7 +120,10 @@ module Vagrant end # Run the action with the action runner on the environment - env = { :machine => self }.merge(extra_env || {}) + env = { + :machine => self, + :ui => @env.ui_class.new(@name) + }.merge(extra_env || {}) @env.action_runner.run(callable, env) end