Merge "Update apiclient from oslo-incubator"

This commit is contained in:
Jenkins 2014-11-26 01:03:26 +00:00 committed by Gerrit Code Review
commit 24ff6c37cb

View File

@ -452,13 +452,10 @@ def from_response(response, method, url):
except ValueError:
pass
else:
if isinstance(body, dict):
error = body.get(list(body)[0])
if isinstance(error, dict):
kwargs["message"] = (error.get("message") or
error.get("faultstring"))
kwargs["details"] = (error.get("details") or
six.text_type(body))
if isinstance(body, dict) and isinstance(body.get("error"), dict):
error = body["error"]
kwargs["message"] = error.get("message")
kwargs["details"] = error.get("details")
elif content_type.startswith("text/"):
kwargs["details"] = response.text