From 66e0b916e487c45f47b0f825033dfdddee07b5e8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 12 Oct 2016 10:48:08 -0400 Subject: [PATCH] Fix webclient viability after error When error encountered, we still need to consume the response with rsp.read(), or else a subsequent request will fail. Change-Id: Ica4f69cadf32a204af3e69a1ee6d336e08f7fc78 --- pyghmi/util/webclient.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 9d953ce7..5c22b5ff 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -63,6 +63,8 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): rsp = self.getresponse() if rsp.status == 200: return json.loads(rsp.read()) + rsp.read() + return {} def request(self, method, url, body=None, headers=None): if headers is None: