Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Diff to fix puppet 3.x.x talking to Pypi after they changed their infrastructure (to do the right thing) on 2018-04-17
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("", 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 ="package_releases", @resource[:name])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.