From 3b0518c8000e31cee6a2857d381d8fa0aea8f3d4 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 25 Dec 2014 20:39:47 -0500 Subject: [PATCH] Set HTTP PUT Content-Length for container actions We are not passing any body for the container actions, so let's default the content length to 0. Otherwise the pecan/wsgi waits for a body and just hangs. Change-Id: I9517f611d5a60791c6a03f37deeaab43d96bcc94 --- magnumclient/api/containers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/magnumclient/api/containers.py b/magnumclient/api/containers.py index e675d528..5ea926fa 100644 --- a/magnumclient/api/containers.py +++ b/magnumclient/api/containers.py @@ -102,9 +102,11 @@ class ContainerManager(base.Manager): return self._update(self._path(id), patch) def _action(self, id, action, **kwargs): + kwargs.setdefault('headers', {}) + kwargs['headers'].setdefault('Content-Length', '0') resp, body = self.api.json_request('PUT', self._path(id) + action, - kwargs) + **kwargs) return resp def start(self, id):