From 78e9853b71cf409758d4705dcd7d8515ab26ad9d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 3 Feb 2013 14:20:40 -0800 Subject: [PATCH] The resource in the UI doesn't show up if it is nil --- lib/vagrant/environment.rb | 2 +- lib/vagrant/ui.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index af779b769..f54b0d018 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -91,7 +91,7 @@ module Vagrant @home_path = opts[:home_path] @lock_path = opts[:lock_path] @vagrantfile_name = opts[:vagrantfile_name] - @ui = opts[:ui_class].new("vagrant") + @ui = opts[:ui_class].new @lock_acquired = false diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 8693b85b1..6266b53d3 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -14,7 +14,7 @@ module Vagrant class Interface attr_accessor :resource - def initialize(resource) + def initialize(resource=nil) @logger = Log4r::Logger.new("vagrant::ui::interface") @resource = resource end @@ -99,7 +99,6 @@ module Vagrant def clear_line reset = "\r" reset += "\e[0K" unless Util::Platform.windows? - reset info(reset, :new_line => false) end @@ -126,7 +125,7 @@ module Vagrant # This is called by `say` to format the message for output. def format_message(type, message, opts=nil) opts ||= {} - message = "[#{@resource}] #{message}" if opts[:prefix] + message = "[#{@resource}] #{message}" if @resource && opts[:prefix] message end end