From cdf8f29e70c15598d0a92c8f17841e58d240f94b Mon Sep 17 00:00:00 2001 From: Jonathan McCall Date: Tue, 23 Jan 2018 13:10:22 -0500 Subject: [PATCH] Add hash making inventory caches unique to inventory script ran (#34742) --- contrib/inventory/ec2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index 30636fc0234..39102ce616b 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -456,6 +456,7 @@ class Ec2Inventory(object): cache_id = self.boto_profile or os.environ.get('AWS_ACCESS_KEY_ID', self.credentials.get('aws_access_key_id')) if cache_id: cache_name = '%s-%s' % (cache_name, cache_id) + cache_name += '-' + str(abs(hash(__file__)))[1:7] self.cache_path_cache = os.path.join(cache_dir, "%s.cache" % cache_name) self.cache_path_index = os.path.join(cache_dir, "%s.index" % cache_name) self.cache_max_age = config.getint('ec2', 'cache_max_age')