substitute tilde and env vars before storing C.CACHE_PLUGIN_CONNECTION as instance attribute

This commit is contained in:
Daniel Menet 2015-11-12 16:52:02 +01:00
parent c1d9649c13
commit 6e04cae21c

View file

@ -37,7 +37,7 @@ class CacheModule(BaseCacheModule):
self._timeout = float(C.CACHE_PLUGIN_TIMEOUT)
self._cache = {}
self._cache_dir = C.CACHE_PLUGIN_CONNECTION # expects a dir path
self._cache_dir = os.path.expandvars(os.path.expanduser(C.CACHE_PLUGIN_CONNECTION)) # expects a dir path
if not self._cache_dir:
utils.exit("error, fact_caching_connection is not set, cannot use fact cache")