Skip to content

Commit a6ecf7e

Browse files
authored
HTTParty will no longer override response#nil?
Get rid off the DEPRECATED warning in related to that functionality.. ==> graylog: [DEPRECATION] HTTParty will no longer override `response#nil?`. This functionality will be removed in future versions. Please, add explicit check `response.body.nil? || response.body.empty?`. For more info refer to: jnunemaker/httparty#568 ==> graylog: /tmp/vagrant-puppet/environments/local/local-modules/graylog_api/lib/puppet/provider/graylog_api.rb:109:in `request' ==> graylog: [DEPRECATION] HTTParty will no longer override `response#nil?`. This functionality will be removed in future versions. Please, add explicit check `response.body.nil? || response.body.empty?`. For more info refer to: jnunemaker/httparty#568
1 parent 661fb48 commit a6ecf7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet/provider/graylog_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def request(method, path, params = {})
9494
**tls_opts
9595
)
9696

97-
if result.body
97+
if result.body && !result.body.empty?
9898
if result.body.include? '"type":"ApiError"'
9999
Puppet.send_log(:err, "Got error response #{result.body}")
100100
raise
@@ -106,7 +106,7 @@ def request(method, path, params = {})
106106
Puppet.send_log(:err, "Got error response #{e.response}")
107107
raise e
108108
end
109-
recursive_nil_to_undef(JSON.parse(result.body)) unless result.nil?
109+
recursive_nil_to_undef(JSON.parse(result.body)) if result.body && !result.body.empty?
110110
end
111111

112112
# Under Puppet Apply, undef in puppet-lang becomes :undef instead of nil

0 commit comments

Comments
 (0)