@ -91,8 +91,11 @@ class BaseFileCacheModule(BaseCacheModule):
try:
try:
os.makedirs(self._cache_dir)
os.makedirs(self._cache_dir)
except(OSError,IOError)ase:
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)))
raiseAnsibleError("error in '%s' cache plugin while trying to create cache dir %s : %s"%(self.plugin_name,self._cache_dir,to_bytes(e)))
returnNone
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):
defget(self,key):
""" This checks the in memory cache first as the fact was not expired at 'gather time'
""" This checks the in memory cache first as the fact was not expired at 'gather time'
@ -146,7 +149,7 @@ class BaseFileCacheModule(BaseCacheModule):
returnFalse
returnFalse
else:
else:
display.warning("error in '%s' cache plugin while trying to stat %s : %s"%(self.plugin_name,cachefile,to_bytes(e)))
display.warning("error in '%s' cache plugin while trying to stat %s : %s"%(self.plugin_name,cachefile,to_bytes(e)))