From 2aff4bf63ca57e0ec1290983f3109e484b95935f Mon Sep 17 00:00:00 2001 From: Eugene Kirpichov Date: Thu, 22 Nov 2012 14:16:25 +0000 Subject: Encode consoleauth token in utf-8 to make it a str Fix for lp:1057279. Change-Id: I9da0fd42e919aca0075613c4930ebfc3cf425349 --- nova/consoleauth/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/consoleauth/manager.py b/nova/consoleauth/manager.py index 910332633..23d0a06f6 100644 --- a/nova/consoleauth/manager.py +++ b/nova/consoleauth/manager.py @@ -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, 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: -- cgit