Actions
Bug #32837
closedDrop unwanted URI parsing from NetHttpExtension
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Description
Ruby Net::HTTP object does not contain URI, it contains address and port attributes which is documented to only old IP address or hostname and port, not URI or URL at all.
In our NetHttpExtension we parse the address into URI and then extract hostname part from there. This works fine for IPv4, however it fails for IPv6 as addresses must be enclosed within square brackets. The patch is removing the not-needed conversion to URI and back. The error I am seeing is coming from discovery:
irb(main):016:0> resource = ::ForemanDiscovery::NodeAPI::Power.service(:url => "https://[2a00:4bc0:1010:1102:0:b19:7175:babe]:8443") => #<ForemanDiscovery::NodeAPI::PowerService:0x0000000012d5f0b8 @args={:url=>"https://[2a00:4bc0:1010:1102:0:b19:7175:babe]:8443"}, @connect_params={:headers=>{:accept=>:json}, :timeout=>20, :verify_ssl=>0}> irb(main):017:0> resource.reboot Traceback (most recent call last): 5: from lib/tasks/console.rake:5:in `block in <top (required)>' 4: from (irb):17 3: from foreman_discovery (16.3.1) app/services/foreman_discovery/node_api/power_service.rb:8:in `reboot' 2: from foreman_discovery (16.3.1) app/services/foreman_discovery/node_api/node_resource.rb:103:in `put' 1: from lib/foreman/http_proxy/net_http_extension.rb:5:in `request' URI::InvalidURIError (bad URI(is not URI?): 2a00:4bc0:1010:1102:0:b19:7175:babe)
Updated by The Foreman Bot over 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8606 added
Updated by Lukas Zapletal over 3 years ago
- Related to Bug #32812: Discovery plugin ignores IPv6 when doing reboot/kexec/fetch facts added
Updated by Amit Upadhye over 3 years ago
- Target version changed from 3.0.0 to 3.0.1
Updated by Amit Upadhye over 3 years ago
- Target version changed from 3.0.1 to 3.0.0
- Fixed in Releases 3.0.0 added
Updated by Lukas Zapletal over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|73a42646743450c709630344b12ba7cf066e2033.
Actions