@ -91,8 +91,11 @@ class BaseFileCacheModule(BaseCacheModule):
try:
os.makedirs(self._cache_dir)
except(OSError,IOError)ase:
display.warning("error in '%s' cache plugin while trying to create cache dir %s : %s"%(self.plugin_name,self._cache_dir,to_bytes(e)))
returnNone
raiseAnsibleError("error in '%s' cache plugin while trying to create cache dir %s : %s"%(self.plugin_name,self._cache_dir,to_bytes(e)))
else:
forxin(os.R_OK,os.W_OK,os.X_OK):
ifnotos.access(self._cache_dir,x):
raiseAnsibleError("error in '%s' cache, configured path (%s) does not have necessary permissions (rwx), disabling plugin"%(self.plugin_name,self._cache_dir))
defget(self,key):
""" This checks the in memory cache first as the fact was not expired at 'gather time'
@ -146,7 +149,7 @@ class BaseFileCacheModule(BaseCacheModule):
returnFalse
else:
display.warning("error in '%s' cache plugin while trying to stat %s : %s"%(self.plugin_name,cachefile,to_bytes(e)))