From 5113a065d7340f8c2650566bf1400e1863c539e2 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Fri, 6 Mar 2015 20:45:02 -0800 Subject: [PATCH] boto: Apply patch needed to fix docker-registry This makes docker-registry work when backed by S3. It's the same patch applied in the docker upstream container image. Backported from boto/boto#2932 --- .../python-modules/boto/content-length-str.patch | 16 ++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/python-modules/boto/content-length-str.patch diff --git a/pkgs/development/python-modules/boto/content-length-str.patch b/pkgs/development/python-modules/boto/content-length-str.patch new file mode 100644 index 00000000000..7895e223c6b --- /dev/null +++ b/pkgs/development/python-modules/boto/content-length-str.patch @@ -0,0 +1,16 @@ +Cherry-picked from https://github.com/boto/boto/pull/2932 + +This fix is required for things like docker-registry to interact with S3. Will +be obsolete after the next boto release (> 2.36.0) + +--- a/boto/connection.py ++++ b/boto/connection.py +@@ -381,7 +381,7 @@ class HTTPRequest(object): + if 'Content-Length' not in self.headers: + if 'Transfer-Encoding' not in self.headers or \ + self.headers['Transfer-Encoding'] != 'chunked': +- self.headers['Content-Length'] = len(self.body) ++ self.headers['Content-Length'] = str(len(self.body)) + + + class HTTPResponse(http_client.HTTPResponse): diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b41732005bf..200c086ed80 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1110,6 +1110,8 @@ let buildInputs = [ self.nose self.mock ]; propagatedBuildInputs = [ self.requests self.httpretty ]; + patches = [ ../development/python-modules/boto/content-length-str.patch ]; + meta = { homepage = https://github.com/boto/boto;