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/memcached.py
vendored
6
plugins/cache/memcached.py
vendored
@ -57,8 +57,9 @@ from ansible.utils.display import Display
|
||||
|
||||
try:
|
||||
import memcache
|
||||
HAS_MEMCACHE = True
|
||||
except ImportError:
|
||||
raise AnsibleError("python-memcached is required for the memcached fact cache")
|
||||
HAS_MEMCACHE = False
|
||||
|
||||
display = Display()
|
||||
|
||||
@ -187,6 +188,9 @@ class CacheModule(BaseCacheModule):
|
||||
self._timeout = C.CACHE_PLUGIN_TIMEOUT
|
||||
self._prefix = C.CACHE_PLUGIN_PREFIX
|
||||
|
||||
if not HAS_MEMCACHE:
|
||||
raise AnsibleError("python-memcached is required for the memcached fact cache")
|
||||
|
||||
self._cache = {}
|
||||
self._db = ProxyClientPool(connection, debug=0)
|
||||
self._keys = CacheModuleKeys(self._db, self._db.get(CacheModuleKeys.PREFIX) or [])
|
||||
|
Reference in New Issue
Block a user