mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix error using jsonfile with incomplete config (#17567)
If 'fact_caching=jsonfile' was configured, but 'fact_caching_connection' was not configured, jsonfile would fail and ansible-playbook would exit with a traceback. Fixes #17566
This commit is contained in:
parent
29fda4be1e
commit
3e754086b6
1 changed files with 5 additions and 1 deletions
4
lib/ansible/plugins/cache/jsonfile.py
vendored
4
lib/ansible/plugins/cache/jsonfile.py
vendored
|
@ -50,6 +50,10 @@ class CacheModule(BaseCacheModule):
|
|||
|
||||
self._timeout = float(C.CACHE_PLUGIN_TIMEOUT)
|
||||
self._cache = {}
|
||||
self._cache_dir = None
|
||||
|
||||
if C.CACHE_PLUGIN_CONNECTION:
|
||||
# expects a dir path
|
||||
self._cache_dir = os.path.expanduser(os.path.expandvars(C.CACHE_PLUGIN_CONNECTION))
|
||||
|
||||
if not self._cache_dir:
|
||||
|
|
Loading…
Add table
Reference in a new issue