Merge "Remove unnecessary try/except from token provider"

This commit is contained in:
Jenkins 2016-08-30 15:14:39 +00:00 committed by Gerrit Code Review
commit 48d2f82ded

View File

@ -23,7 +23,7 @@ from keystone.common import utils
import keystone.conf
from keystone import exception
from keystone.federation import constants as federation_constants
from keystone.i18n import _, _LE
from keystone.i18n import _
from keystone import token
from keystone.token import provider
@ -766,7 +766,6 @@ class BaseProvider(provider.Provider):
raise exception.Unauthorized(msg)
def validate_v2_token(self, token_ref):
try:
self._assert_is_not_federation_token(token_ref)
self._assert_default_domain(token_ref)
# FIXME(gyee): performance or correctness? Should we return the
@ -783,11 +782,7 @@ class BaseProvider(provider.Provider):
# Validate the V3 token as V2
token_data = self.v2_token_data_helper.v3_to_v2_token(
token_data, token_id)
return token_data
except exception.ValidationError:
LOG.exception(_LE('Failed to validate token'))
raise exception.TokenNotFound(token_id=token_id)
def validate_non_persistent_token(self, token_id):
try: