Support error messages from the new API server

Change-Id: I43c6ad3bd89b21ea162263d11a8db22439d18ffa
This commit is contained in:
Andrew Hutchings
2013-05-31 20:26:24 +01:00
parent 732bfb4c28
commit 662cb2bb6c
2 changed files with 4 additions and 2 deletions

View File

@@ -44,7 +44,9 @@ def from_response(response, body, url, method=None):
message = "n/a"
details = "n/a"
if hasattr(body, 'keys'):
message = body.get('message', None)
message = body.get('faultstring', None)
if not message:
message = body.get('message', None)
details = body.get('details', None)
return cls(code=response.status_code, message=message, details=details,
request_id=request_id, url=url, method=method)

View File

@@ -1 +1 @@
python_novaclient>=2.11.1
python_novaclient==2.11.1