Created
April 17, 2018 20:21
-
-
Save barn/ab4aabe10c773dcdc243726600c9c9cf to your computer and use it in GitHub Desktop.
Diff to fix puppet 3.x.x talking to Pypi after they changed their infrastructure (to do the right thing) on 2018-04-17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/lib/puppet/provider/package/pip.rb w/lib/puppet/provider/package/pip.rb | |
index 8e889a0b1..0204b17d0 100644 | |
--- i/lib/puppet/provider/package/pip.rb | |
+++ w/lib/puppet/provider/package/pip.rb | |
@@ -68,6 +68,9 @@ Puppet::Type.type(:package).provide :pip, | |
client = XMLRPC::Client.new2("http://pypi.python.org/pypi", proxy) | |
client.http_header_extra = {"Content-Type" => "text/xml"} | |
+ # also add an accept header, as the pypi infra changed and now they | |
+ # will gzip the response, which xmlrpc client will not handle. | |
+ client.http_header_extra = {"Accept-Encoding" => "text/xml"} | |
client.timeout = 10 | |
result = client.call("package_releases", @resource[:name]) | |
result.first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment