Encode consoleauth token in utf-8 to make it a str

Fix for lp:1057279.

Change-Id: I9da0fd42e919aca0075613c4930ebfc3cf425349
This commit is contained in:
Eugene Kirpichov 2012-11-22 14:16:25 +00:00
parent eb70e7e2dd
commit 9c7a7116b8

View File

@ -66,11 +66,11 @@ class ConsoleAuthManager(manager.Manager):
'internal_access_path': internal_access_path,
'last_activity_at': time.time()}
data = jsonutils.dumps(token_dict)
self.mc.set(token, data, FLAGS.console_token_ttl)
self.mc.set(token.encode('UTF-8'), data, FLAGS.console_token_ttl)
LOG.audit(_("Received Token: %(token)s, %(token_dict)s)"), locals())
def check_token(self, context, token):
token_str = self.mc.get(token)
token_str = self.mc.get(token.encode('UTF-8'))
token_valid = (token_str is not None)
LOG.audit(_("Checking Token: %(token)s, %(token_valid)s)"), locals())
if token_valid: