Merge "Remove redundant statement and refactor"

This commit is contained in:
Jenkins
2015-08-14 05:51:59 +00:00
committed by Gerrit Code Review

View File

@@ -238,14 +238,12 @@ class HTTPClient(object):
**kwargs)
self.http_log_resp(resp)
body = None
if resp.text:
try:
body = json.loads(resp.text)
except ValueError:
pass
body = None
else:
body = None
except ValueError as e:
self._logger.debug("Load http response text error: %s", e)
if resp.status_code >= 400:
raise exceptions.from_response(resp, body)