diff --git a/openstack_auth/user.py b/openstack_auth/user.py index b996dc1e..1f184f26 100644 --- a/openstack_auth/user.py +++ b/openstack_auth/user.py @@ -22,7 +22,7 @@ from keystoneclient import exceptions as keystone_exceptions from .utils import check_token_expiration from .utils import get_keystone_version from .utils import get_project_list -from .utils import is_ans1_token +from .utils import is_asn1_token LOG = logging.getLogger(__name__) @@ -71,7 +71,7 @@ class Token(object): #Token-related attributes self.id = auth_ref.auth_token - if is_ans1_token(self.id): + if is_asn1_token(self.id): self.id = hashlib.md5(self.id).hexdigest() self.expires = auth_ref.expires diff --git a/openstack_auth/utils.py b/openstack_auth/utils.py index c749f42a..678ef609 100644 --- a/openstack_auth/utils.py +++ b/openstack_auth/utils.py @@ -77,10 +77,10 @@ def check_token_expiration(token): # Copied from Keystone's keystone/common/cms.py file. -PKI_ANS1_PREFIX = 'MII' +PKI_ASN1_PREFIX = 'MII' -def is_ans1_token(token): +def is_asn1_token(token): ''' thx to ayoung for sorting this out. @@ -119,7 +119,7 @@ def is_ans1_token(token): It's not practical to support a token of this length or greater in http therefore, we will check for MII only and ignore the case of larger tokens ''' - return token[:3] == PKI_ANS1_PREFIX + return token[:3] == PKI_ASN1_PREFIX # From django.contrib.auth.views