Fix the linode inventory plugin, and the redis and memcached cache plugins (#1281, #1282, #1283).

This commit is contained in:
Felix Fontein 2020-11-13 21:34:56 +01:00 committed by David Moreau Simard
commit 75fd32ca55
4 changed files with 19 additions and 3 deletions

View file

@ -73,8 +73,9 @@ from ansible.utils.display import Display
try:
from redis import StrictRedis, VERSION
HAS_REDIS = True
except ImportError:
raise AnsibleError("The 'redis' python module (version 2.4.5 or newer) is required for the redis fact cache, 'pip install redis'")
HAS_REDIS = False
display = Display()
@ -111,6 +112,9 @@ class CacheModule(BaseCacheModule):
self._prefix = C.CACHE_PLUGIN_PREFIX
self._keys_set = 'ansible_cache_keys'
if not HAS_REDIS:
raise AnsibleError("The 'redis' python module (version 2.4.5 or newer) is required for the redis fact cache, 'pip install redis'")
self._cache = {}
kw = {}