From ce92f37f0be5c6293ddb744eb618db91dda0b058 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Tue, 15 Apr 2014 09:29:20 +1000 Subject: [PATCH] Rename HTTPError -> HttpError With the move to the apiclient exceptions from oslo the basic HTTP error class was renamed. This was not reflected in all places in the code. It was also not picked up by the tests because the apiclient tests weren't running due to a missing __init__.py file. Because this should be backwards compatible it was added to the list in exceptions, the check that this is available is in the (now running) apiclient tests. Blueprint: common-client-library-2 Change-Id: I307c1083f29e3207cc86aa938043270e5c32b4bb --- keystoneclient/auth/identity/base.py | 8 ++++---- keystoneclient/exceptions.py | 1 + keystoneclient/session.py | 2 +- keystoneclient/tests/apiclient/__init__.py | 0 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 keystoneclient/tests/apiclient/__init__.py diff --git a/keystoneclient/auth/identity/base.py b/keystoneclient/auth/identity/base.py index a63f30328..d0b155ebe 100644 --- a/keystoneclient/auth/identity/base.py +++ b/keystoneclient/auth/identity/base.py @@ -58,7 +58,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): when invoked. If you are looking to just retrieve the current auth data then you should use get_access. - :raises HTTPError: An error from an invalid HTTP response. + :raises HttpError: An error from an invalid HTTP response. :returns AccessInfo: Token access information. """ @@ -68,7 +68,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): If a valid token is not present then a new one will be fetched. - :raises HTTPError: An error from an invalid HTTP response. + :raises HttpError: An error from an invalid HTTP response. :return string: A valid token. """ @@ -80,7 +80,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): If a valid AccessInfo is present then it is returned otherwise a new one will be fetched. - :raises HTTPError: An error from an invalid HTTP response. + :raises HttpError: An error from an invalid HTTP response. :returns AccessInfo: Valid AccessInfo """ @@ -106,7 +106,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): :param string region_name: The region the endpoint should exist in. (optional) - :raises HTTPError: An error from an invalid HTTP response. + :raises HttpError: An error from an invalid HTTP response. :return string or None: A valid endpoint URL or None if not available. """ diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py index c688facee..d9d3f382f 100644 --- a/keystoneclient/exceptions.py +++ b/keystoneclient/exceptions.py @@ -25,6 +25,7 @@ from keystoneclient.openstack.common.apiclient.exceptions import * ConnectionError = ConnectionRefused HTTPNotImplemented = HttpNotImplemented Timeout = RequestTimeout +HTTPError = HttpError class CertificateConfigError(Exception): diff --git a/keystoneclient/session.py b/keystoneclient/session.py index b0f473494..650cbfcc9 100644 --- a/keystoneclient/session.py +++ b/keystoneclient/session.py @@ -385,7 +385,7 @@ class Session(object): try: return auth.get_token(self) - except exceptions.HTTPError as exc: + except exceptions.HttpError as exc: raise exceptions.AuthorizationFailure("Authentication failure: " "%s" % exc) diff --git a/keystoneclient/tests/apiclient/__init__.py b/keystoneclient/tests/apiclient/__init__.py new file mode 100644 index 000000000..e69de29bb