mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-19 19:30:22 -07:00
This commit is contained in:
parent
07fa7ea409
commit
75fd32ca55
4 changed files with 19 additions and 3 deletions
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 = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue