Merge "simplify cache generation"

This commit is contained in:
Zuul 2017-12-06 23:52:12 +00:00 committed by Gerrit Code Review
commit 64fc0cc53f
1 changed files with 2 additions and 2 deletions

View File

@ -461,8 +461,8 @@ class GnocchiPublisher(publisher.ConfigPublisherBase):
def _check_resource_cache(self, key, resource_data):
cached_hash = self.cache.get(key)
attribute_hash = hash(frozenset(filter(lambda x: x[0] != "metrics",
resource_data.items())))
attribute_hash = hash(tuple(i for i in resource_data.items()
if i[0] != 'metrics'))
if not cached_hash or cached_hash != attribute_hash:
return attribute_hash
else: