summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Florea <dflorea@cisco.com>2013-04-30 21:02:18 -0700
committerDan Florea <dflorea@cisco.com>2013-04-30 21:02:18 -0700
commit37fbfad813e12d00da8f9d3e9f6f13256d5bb7c1 (patch)
tree934d60c6f49f3cce42e307fdbae5dc0df223c105
parentdccbcc84a922d16eb230491e2a4d486fdb19b40f (diff)
downloadnova-37fbfad813e12d00da8f9d3e9f6f13256d5bb7c1.tar.gz
nova-37fbfad813e12d00da8f9d3e9f6f13256d5bb7c1.tar.xz
nova-37fbfad813e12d00da8f9d3e9f6f13256d5bb7c1.zip
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
-rw-r--r--nova/api/ec2/ec2utils.py1
1 files changed, 1 insertions, 0 deletions
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)