diff --git a/lib/puppet/provider/heat_domain_id_setter/ruby.rb b/lib/puppet/provider/heat_domain_id_setter/ruby.rb index ed1d34db..e48691fd 100644 --- a/lib/puppet/provider/heat_domain_id_setter/ruby.rb +++ b/lib/puppet/provider/heat_domain_id_setter/ruby.rb @@ -30,7 +30,13 @@ end # A parsed URL (returned from URI.parse) def handle_request(req, url) begin - res = Net::HTTP.start(url.host, url.port) {|http| + # There is issue with ipv6 where address has to be in brackets, this causes the + # underlying ruby TCPSocket to fail. Net::HTTP.new will fail without brackets on + # joining the ipv6 address with :port or passing brackets to TCPSocket. It was + # found that if we use Net::HTTP.start with url.hostname the incriminated code + # won't be hit. + use_ssl = url.scheme == "https" ? true : false + res = Net::HTTP.start(url.hostname, url.port, {:use_ssl => use_ssl}) {|http| http.request(req) }