Skip to content

Commit bae1dc7

Browse files
committed
(CONT-773) Set toapt_key open calls to URI.open
Calls to `open` have previously been left vague, which has caused issues upon implementing Ruby 3
1 parent 3cff22c commit bae1dc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet/provider/apt_key/apt_key.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ def source_to_file(value)
135135
# Some webservers (e.g. Amazon S3) return code 400 if empty basic auth is sent
136136
if parsed_value.userinfo.nil?
137137
key = if parsed_value.scheme == 'https' && resource[:weak_ssl] == true
138-
open(parsed_value, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE).read
138+
URI.open(parsed_value, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE).read
139139
else
140140
parsed_value.read
141141
end
142142
else
143143
user_pass = parsed_value.userinfo.split(':')
144144
parsed_value.userinfo = ''
145-
key = open(parsed_value, http_basic_authentication: user_pass).read
145+
key = URI.open(parsed_value, http_basic_authentication: user_pass).read
146146
end
147147
rescue *exceptions => e
148148
raise(_('%{_e} for %{_resource}') % { _e: e.message, _resource: resource[:source] })

0 commit comments

Comments
 (0)