From 6e51ae3dab2ec752c18d62baa153a747ac9da2d3 Mon Sep 17 00:00:00 2001 From: John Dickinson Date: Fri, 5 Nov 2010 14:06:52 -0500 Subject: [PATCH] added prefix to memcache key used --- swift/common/middleware/cname_lookup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swift/common/middleware/cname_lookup.py b/swift/common/middleware/cname_lookup.py index fa8a37792f..128b4a2b8f 100644 --- a/swift/common/middleware/cname_lookup.py +++ b/swift/common/middleware/cname_lookup.py @@ -71,11 +71,13 @@ class CNAMELookupMiddleware(object): for tries in xrange(self.lookup_depth): found_domain = None if self.memcache: - found_domain = self.memcache.get(a_domain) + memcache_key = ''.join(['cname-', a_domain]) + found_domain = self.memcache.get(memcache_key) if not found_domain: ttl, found_domain = lookup_cname(a_domain) if self.memcache: - self.memcache.set(given_domain, found_domain, + memcache_key = ''.join(['cname-', given_domain]) + self.memcache.set(memcache_key, found_domain, timeout=ttl) if found_domain is None: # something weird happened