Skip to content

Commit

Permalink
Encode consoleauth token in utf-8 to make it a str
Browse files Browse the repository at this point in the history
Fix for lp:1057279.

Change-Id: I9da0fd42e919aca0075613c4930ebfc3cf425349
  • Loading branch information
jkff committed Nov 23, 2012
1 parent 2e1ff2e commit 2aff4bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nova/consoleauth/manager.py
Expand Up @@ -66,11 +66,11 @@ def authorize_console(self, context, token, console_type, host, port,
'internal_access_path': internal_access_path,
'last_activity_at': time.time()}
data = jsonutils.dumps(token_dict)
self.mc.set(token, data, CONF.console_token_ttl)
self.mc.set(token.encode('UTF-8'), data, CONF.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:
Expand Down

0 comments on commit 2aff4bf

Please sign in to comment.