X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/afcb07ba438a01c65d701902dfcb39b04a0719ec..8273ef2eea66bd68ce328ebc78b1c5f49513e35c:/cookbooks/wordpress/libraries/wordpress.rb diff --git a/cookbooks/wordpress/libraries/wordpress.rb b/cookbooks/wordpress/libraries/wordpress.rb index 56df13936..73a0a5467 100644 --- a/cookbooks/wordpress/libraries/wordpress.rb +++ b/cookbooks/wordpress/libraries/wordpress.rb @@ -1,13 +1,8 @@ -require "chef/mixin/shell_out" - -require "addressable" -require "httpclient" require "json" +require "net/http" class Chef module Wordpress - extend Chef::Mixin::ShellOut - @api_responses = {} class << self @@ -22,7 +17,7 @@ class Chef private def core_version_check - api_get("https://api.wordpress.org/core/version-check/1.7") + api_get("https://api.wordpress.org/core/version-check/1.7/") end def plugin_information(name) @@ -30,9 +25,7 @@ class Chef end def api_get(url) - http_client = ::HTTPClient.new - http_client.ssl_config.set_trust_ca("/etc/ssl/certs/ca-certificates.crt") - @api_responses[url] ||= ::JSON.parse(http_client.get_content(url)) + @api_responses[url] ||= ::JSON.parse(Net::HTTP.get(URI(url))) end end end