Merge "Update apiclient from oslo-incubator"
This commit is contained in:
commit
24ff6c37cb
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user