Fix typo of ANS1 to ASN1

Replace all occurrences of 'ANS1|ans1' with 'ASN1|asn1'.

Change-Id: I65eb72870803b019eae66b1b8a18ceeeb34b95ba
Closes-bug: 1306874
This commit is contained in:
mathrock 2014-04-12 00:59:18 -04:00
parent cac04115bb
commit 80178d821c
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ from keystoneclient import exceptions as keystone_exceptions
from .utils import check_token_expiration from .utils import check_token_expiration
from .utils import get_keystone_version from .utils import get_keystone_version
from .utils import get_project_list from .utils import get_project_list
from .utils import is_ans1_token from .utils import is_asn1_token
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -71,7 +71,7 @@ class Token(object):
#Token-related attributes #Token-related attributes
self.id = auth_ref.auth_token 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.id = hashlib.md5(self.id).hexdigest()
self.expires = auth_ref.expires self.expires = auth_ref.expires

View File

@ -77,10 +77,10 @@ def check_token_expiration(token):
# Copied from Keystone's keystone/common/cms.py file. # 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. 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 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 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 # From django.contrib.auth.views