From a11c41b48dff83a91eaa65630cc6aeb0e51e6461 Mon Sep 17 00:00:00 2001 From: Dan Florea Date: Tue, 26 Mar 2013 23:00:32 -0700 Subject: [PATCH] Convert host value from unicode to a string. The memcached API expects string format, not unicode. Convert the host value to a string before creating the cache_key and passing it to memcached. Fixes: bug #1158958 Change-Id: I26e86b7fb61b4b3380a14686bd2faa9f58017999 --- .../api/openstack/compute/contrib/extended_availability_zone.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/api/openstack/compute/contrib/extended_availability_zone.py b/nova/api/openstack/compute/contrib/extended_availability_zone.py index af557219f79..a1ee85bcf0a 100644 --- a/nova/api/openstack/compute/contrib/extended_availability_zone.py +++ b/nova/api/openstack/compute/contrib/extended_availability_zone.py @@ -37,7 +37,7 @@ def __init__(self): self.mc = memorycache.get_client() def _get_host_az(self, context, instance): - host = instance.get('host') + host = str(instance.get('host')) if not host: return None cache_key = "azcache-%s" % host