lib/chef_metal/transport/ssh.rb in chef-metal-0.11.beta.11 vs lib/chef_metal/transport/ssh.rb in chef-metal-0.11
- old
+ new
@@ -108,13 +108,12 @@
def make_url_available_to_remote(local_url)
uri = URI(local_url)
host = Socket.getaddrinfo(uri.host, uri.scheme, nil, :STREAM)[0][3]
if host == '127.0.0.1' || host == '[::1]'
- unless session.forward.active_remotes.any? { |port, bind| port == uri.port && bind == '127.0.0.1' }
- # TODO IPv6
- Chef::Log.debug("Forwarding local server 127.0.0.1:#{uri.port} to port #{uri.port} on #{username}@#{host}")
- session.forward.remote(uri.port, '127.0.0.1', uri.port)
+ unless session.forward.active_remotes.any? { |port, bind| port == uri.port && bind == uri.host }
+ Chef::Log.debug("Forwarding local server #{uri.host}:#{uri.port} to port #{uri.port} on #{username}@#{self.host}")
+ session.forward.remote(uri.port, uri.host, uri.port)
end
end
local_url
end