mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 19:57:47 +00:00
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
This commit is contained in:
parent
aee3ae36b0
commit
66e0b916e4
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user