From 1dad720ef588fcdcf7eec409dbc472ba52f085d0 Mon Sep 17 00:00:00 2001 From: Stefan Nica Date: Fri, 15 Sep 2017 13:39:37 +0200 Subject: [PATCH] fix ec2-api-metadata memcached overlap with nova-api When ec2-api-metadata and nova-api are using the same memcached server as a cache backend, the cached values get intermixed due to the fact that the cache keys are the same. The result is that either nova-api or ec2-api-metadata will report cache value errors. This commit fixes this potential problem by using a different cache key prefix for the ec2-api metadata entries. Change-Id: Ibd26b33b3370d5c9c6cca0bb6e0d9c9eb03c0d50 Closes-Bug: #1717494 --- ec2api/metadata/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec2api/metadata/api.py b/ec2api/metadata/api.py index 10a2bc93..2e3fa07f 100644 --- a/ec2api/metadata/api.py +++ b/ec2api/metadata/api.py @@ -100,7 +100,7 @@ def get_metadata_item(context, path_tokens, os_instance_id, remote_ip, elif version not in VERSIONS: raise exception.EC2MetadataNotFound() - cache_key = 'metadata-%s' % os_instance_id + cache_key = 'ec2api-metadata-%s' % os_instance_id cache = cache_region.get( cache_key, expiration_time=CONF.metadata.cache_expiration) if cache and cache != cache_core.NO_VALUE: