Method: ChefApply::UI::ErrorPrinter#formatted_host

Defined in:
lib/chef_apply/ui/error_printer.rb

#formatted_hostObject



216
217
218
219
220
221
222
223
# File 'lib/chef_apply/ui/error_printer.rb', line 216

def formatted_host
  return nil if target_host.nil?

  cfg = target_host.config
  port = cfg[:port].nil? ? "" : ":#{cfg[:port]}"
  user = cfg[:user].nil? ? "" : "#{cfg[:user]}@"
  "#{user}#{target_host.hostname}#{port}"
end