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