The resource in the UI doesn't show up if it is nil
This commit is contained in:
parent
3df6088db0
commit
78e9853b71
|
@ -91,7 +91,7 @@ module Vagrant
|
||||||
@home_path = opts[:home_path]
|
@home_path = opts[:home_path]
|
||||||
@lock_path = opts[:lock_path]
|
@lock_path = opts[:lock_path]
|
||||||
@vagrantfile_name = opts[:vagrantfile_name]
|
@vagrantfile_name = opts[:vagrantfile_name]
|
||||||
@ui = opts[:ui_class].new("vagrant")
|
@ui = opts[:ui_class].new
|
||||||
|
|
||||||
@lock_acquired = false
|
@lock_acquired = false
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Vagrant
|
||||||
class Interface
|
class Interface
|
||||||
attr_accessor :resource
|
attr_accessor :resource
|
||||||
|
|
||||||
def initialize(resource)
|
def initialize(resource=nil)
|
||||||
@logger = Log4r::Logger.new("vagrant::ui::interface")
|
@logger = Log4r::Logger.new("vagrant::ui::interface")
|
||||||
@resource = resource
|
@resource = resource
|
||||||
end
|
end
|
||||||
|
@ -99,7 +99,6 @@ module Vagrant
|
||||||
def clear_line
|
def clear_line
|
||||||
reset = "\r"
|
reset = "\r"
|
||||||
reset += "\e[0K" unless Util::Platform.windows?
|
reset += "\e[0K" unless Util::Platform.windows?
|
||||||
reset
|
|
||||||
|
|
||||||
info(reset, :new_line => false)
|
info(reset, :new_line => false)
|
||||||
end
|
end
|
||||||
|
@ -126,7 +125,7 @@ module Vagrant
|
||||||
# This is called by `say` to format the message for output.
|
# This is called by `say` to format the message for output.
|
||||||
def format_message(type, message, opts=nil)
|
def format_message(type, message, opts=nil)
|
||||||
opts ||= {}
|
opts ||= {}
|
||||||
message = "[#{@resource}] #{message}" if opts[:prefix]
|
message = "[#{@resource}] #{message}" if @resource && opts[:prefix]
|
||||||
message
|
message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue