From e32136ac6e2d96f1e1dd36a16db628b0f686ac7c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 24 Jul 2015 02:46:36 +0200 Subject: AWSTags: Expire metadata cache at start of client run AWSTags cannot know whether the tags change, so it cannot expire the metadata cache correctly. Instead we have to expire the cache at beginning of each client run. This practically disables agressive client metadata caching, so we print a warning. --- src/lib/Bcfg2/Server/Plugins/AWSTags.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/Bcfg2/Server/Plugins/AWSTags.py b/src/lib/Bcfg2/Server/Plugins/AWSTags.py index 0d6eefaaa..556805bde 100644 --- a/src/lib/Bcfg2/Server/Plugins/AWSTags.py +++ b/src/lib/Bcfg2/Server/Plugins/AWSTags.py @@ -172,6 +172,11 @@ class AWSTags(Bcfg2.Server.Plugin.Plugin, def start_client_run(self, metadata): self.expire_cache(key=metadata.hostname) + if self.core.metadata_cache_mode == 'aggressive': + self.logger.warning("AWSTags is incompatible with aggressive " + "client metadata caching, try 'cautious' " + "or 'initial'") + self.core.metadata_cache.expire(metadata.hostname) def get_additional_data(self, metadata): return self.get_tags(metadata) -- cgit v1.2.3-1-g7c22