diff --git a/cinderclient/exceptions.py b/cinderclient/exceptions.py index 41796e34a..751e42592 100644 --- a/cinderclient/exceptions.py +++ b/cinderclient/exceptions.py @@ -181,4 +181,5 @@ def from_response(response, body): return cls(code=response.status_code, message=message, details=details, request_id=request_id) else: - return cls(code=response.status_code, request_id=request_id) + return cls(code=response.status_code, request_id=request_id, + message=response.reason) diff --git a/cinderclient/tests/utils.py b/cinderclient/tests/utils.py index 0deb579bf..d6c48ceab 100644 --- a/cinderclient/tests/utils.py +++ b/cinderclient/tests/utils.py @@ -46,6 +46,7 @@ class TestResponse(requests.Response): if isinstance(data, dict): self.status_code = data.get('status_code', None) self.headers = data.get('headers', None) + self.reason = data.get('reason', '') # Fake the text attribute to streamline Response creation self._text = data.get('text', None) else: