You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-29 07:41:16 +03:00
This commit is contained in:
committed by
David Moreau Simard
parent
07fa7ea409
commit
75fd32ca55
6
plugins/cache/redis.py
vendored
6
plugins/cache/redis.py
vendored
@ -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 = {}
|
||||
|
||||
|
Reference in New Issue
Block a user