diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-01-16 20:33:52 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-02-04 21:51:04 +0100 |
commit | 6f28bdabe9fe44503608e7d3f41a5e75e8d7f384 (patch) | |
tree | e7d65a3009120015ca4f5c40b108c82edeea33fd /keystoneclient/common | |
parent | eab811c307db77740bd00ee1a37d2e93c1ca622e (diff) | |
download | python-keystoneclient-6f28bdabe9fe44503608e7d3f41a5e75e8d7f384.tar.gz |
Python 3: make tests from v2_0/test_access.py pass
This fixes calls to the hash_signed_token() and cms_hash_token() functions, by
making sure they are given bytes.
Change-Id: I83ac48a845cd09150b01afad6f0549ee83c20ddd
Diffstat (limited to 'keystoneclient/common')
-rw-r--r-- | keystoneclient/common/cms.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/keystoneclient/common/cms.py b/keystoneclient/common/cms.py index 0e6a5b7..eb64e1f 100644 --- a/keystoneclient/common/cms.py +++ b/keystoneclient/common/cms.py @@ -24,6 +24,7 @@ or eventlet.green.subprocess based on if os module is patched by eventlet. import errno import hashlib import logging +import six from keystoneclient import exceptions @@ -263,6 +264,8 @@ def cms_hash_token(token_id): return None if is_ans1_token(token_id): hasher = hashlib.md5() + if isinstance(token_id, six.text_type): + token_id = token_id.encode('utf-8') hasher.update(token_id) return hasher.hexdigest() else: |