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: except ValueError:
pass pass
else: else:
if isinstance(body, dict): if isinstance(body, dict) and isinstance(body.get("error"), dict):
error = body.get(list(body)[0]) error = body["error"]
if isinstance(error, dict): kwargs["message"] = error.get("message")
kwargs["message"] = (error.get("message") or kwargs["details"] = error.get("details")
error.get("faultstring"))
kwargs["details"] = (error.get("details") or
six.text_type(body))
elif content_type.startswith("text/"): elif content_type.startswith("text/"):
kwargs["details"] = response.text kwargs["details"] = response.text