From 37fbfad813e12d00da8f9d3e9f6f13256d5bb7c1 Mon Sep 17 00:00:00 2001 From: Dan Florea Date: Tue, 30 Apr 2013 21:02:18 -0700 Subject: Convert the cache key from unicode to a string. The memcached API expects string format, not unicode. Convert the key passed to the memory cache to a string before sending it to memcached. Since both the function name and the id that form the key are ascii format, a simple conversion from unicode to str is sufficient. Change-Id: I9d15858ad4e10aa183444cccda9c33676059e55a Fixes: bug #1174487 --- nova/api/ec2/ec2utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nova/api/ec2/ec2utils.py b/nova/api/ec2/ec2utils.py index 660c0e8d4..150ab9dae 100644 --- a/nova/api/ec2/ec2utils.py +++ b/nova/api/ec2/ec2utils.py @@ -42,6 +42,7 @@ def memoize(func): if not _CACHE: _CACHE = memorycache.get_client() key = "%s:%s" % (func.__name__, reqid) + key = str(key) value = _CACHE.get(key) if value is None: value = func(context, reqid) -- cgit