summaryrefslogtreecommitdiff
path: root/novaclient/exceptions.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2014-07-11 13:29:34 -0400
committerRussell Bryant <rbryant@redhat.com>2014-07-11 13:30:25 -0400
commite14f9741a6fedc2ed4cddd304b2f86378b707575 (patch)
tree87eb8d711bc33b5000edcd8f581866e1e5bf9041 /novaclient/exceptions.py
parentf1db442becbdb3552360e3b78f215dc3a045bd91 (diff)
downloadpython-novaclient-e14f9741a6fedc2ed4cddd304b2f86378b707575.tar.gz
Revert "Set default http-based exception as `HttpError`"
This reverts commit 4e1ee661083bd672a884fd13fdb1ffaadea5252a. This change is a part of a series that is not backwards compatible, and caused breakage in applications that use the client library. Change-Id: If614826fb0832602110c1ac8be2c0e6324a5a248 Partial-Bug: #1340596
Diffstat (limited to 'novaclient/exceptions.py')
-rw-r--r--novaclient/exceptions.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/novaclient/exceptions.py b/novaclient/exceptions.py
index 73f04dce..6c1c2deb 100644
--- a/novaclient/exceptions.py
+++ b/novaclient/exceptions.py
@@ -28,15 +28,6 @@ from novaclient.openstack.common.apiclient.exceptions import * # noqa
OverLimit = RequestEntityTooLarge
-def _deprecate_code_attribute(slf):
- import warnings
- warnings.warn("'code' attribute is deprecated since v.2.17.0. Use "
- "'http_status' instead of this one.", UserWarning)
- return slf.http_status
-
-HttpError.code = property(_deprecate_code_attribute)
-
-
class NoTokenLookupException(ClientException):
"""This form of authentication does not support looking up
endpoints from an existing token.
@@ -76,7 +67,7 @@ class InvalidUsage(RuntimeError):
def from_response(response, body, url, method=None):
"""
- Return an instance of an HttpError or subclass
+ Return an instance of an ClientException or subclass
based on an requests response.
Usage::
@@ -110,6 +101,5 @@ def from_response(response, body, url, method=None):
kwargs['message'] = message
kwargs['details'] = details
- cls = _code_map.get(response.status_code, HttpError)
-
+ cls = _code_map.get(response.status_code, ClientException)
return cls(**kwargs)