def initialize(hostname, data = {})
uri = URI.parse(hostname)
if !uri.host && ((!uri.scheme && uri.path) || (uri.scheme && uri.opaque))
uri = URI.parse("ssh://#{hostname}")
end
if uri.path && uri.path.empty?
uri.path = nil
end
@backend_name = uri.scheme
@hostname = uri.host
@port = uri.port
@username = uri.user || Etc.getpwuid.name
@remote_username = uri.user
@path = uri.path || "/var/tmp/chef.#{username}"
@data = data
if @hostname.length > self.class.max_node_name_length
self.class.max_node_name_length = @hostname.length
end
end