Last active
June 11, 2019 22:00
-
-
Save s-hertel/50f72d8f521378225a3cdc0b42644509 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ansible/plugins/cache/__init__.py b/lib/ansible/plugins/cache/__init__.py | |
index fbc4122aca..6de6a064c5 100644 | |
--- a/lib/ansible/plugins/cache/__init__.py | |
+++ b/lib/ansible/plugins/cache/__init__.py | |
@@ -306,10 +306,9 @@ class CachePluginAdjudicator(MutableMapping): | |
def _do_load_key(self, key): | |
load = False | |
if key not in self._cache and key not in self._retrieved and self._plugin_name != 'memory': | |
- if isinstance(self._plugin, BaseFileCacheModule): | |
- load = True | |
- elif not isinstance(self._plugin, BaseFileCacheModule) and self._plugin.contains(key): | |
- # Database-backed caches don't raise KeyError for expired keys, so only load if the key is valid by checking contains() | |
+ # Note that only file-backed caches raise a KeyError using self._plugin.get(), but will also give an unwarranted warning | |
+ # check whether the plugin contains the Key for uniformity between file-backed and database-backed caches | |
+ if self._plugin.contains(key): | |
load = True | |
return load |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment