Merge "Allow compatibility with keystonemiddleware 4.0.0"

This commit is contained in:
Jenkins 2016-09-14 22:05:30 +00:00 committed by Gerrit Code Review
commit 84f032cccc
1 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,15 @@
# under the License.
from keystonemiddleware import auth_token
# TODO(stevemar): Remove this check once global-requirements depends on a
# version of keystonemiddleware greater than 4.2.0. We caught this issue too
# late in the Newton development cycle to unfreeze global requirements.
try:
BaseAuthProtocol = auth_token.BaseAuthProtocol
except AttributeError:
BaseAuthProtocol = auth_token._BaseAuthProtocol
from oslo_log import log
from oslo_log import versionutils
@ -35,7 +44,7 @@ __all__ = ('AuthContextMiddleware',)
@dependency.requires('token_provider_api')
class AuthContextMiddleware(auth_token.BaseAuthProtocol):
class AuthContextMiddleware(BaseAuthProtocol):
"""Build the authentication context from the request auth token."""
def __init__(self, app):