From b21fae99c556b05dd31f3ebb67dfeb6918762ff1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 25 Aug 2010 22:30:57 -0700 Subject: [PATCH] Child UIs successfully set environment to themselves --- lib/vagrant/environment.rb | 9 +++++++-- lib/vagrant/ui.rb | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index a4541bc51..425467ace 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -138,8 +138,13 @@ module Vagrant # Returns the {UI} for the environment, which is responsible # for talking with the outside world. def ui - return parent.ui if parent - @ui ||= UI.new(self) + @ui ||= if parent + result = parent.ui.clone + result.env = self + result + else + UI.new(self) + end end #--------------------------------------------------------------- diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index bf8e56358..03e195af1 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -5,7 +5,7 @@ module Vagrant # through a shell). They must respond to the typically logger methods # of `warn`, `error`, `info`, and `confirm`. class UI - attr_reader :env + attr_accessor :env def initialize(env) @env = env