raiseAnsibleError("error, '%s' cache plugin requires the 'fact_caching_connection' config option to be set (to a writeable directory path)"%self.plugin_name)
raiseAnsibleError("error, '%s' cache plugin requires the 'fact_caching_connection' config option"
" to be set (to a writeable directory path)"%self.plugin_name)
ifnotos.path.exists(self._cache_dir):
ifnotos.path.exists(self._cache_dir):
try:
try:
@ -111,15 +107,16 @@ class BaseFileCacheModule(BaseCacheModule):
display.warning("error in '%s' cache plugin while trying to read %s : %s. Most likely a corrupt file, so erasing and failing."%(self.plugin_name,cachefile,to_bytes(e)))
display.warning("error in '%s' cache plugin while trying to read %s : %s."
" Most likely a corrupt file, so erasing and failing."%(self.plugin_name,cachefile,to_bytes(e)))
self.delete(key)
self.delete(key)
raiseAnsibleError("The cache file %s was corrupt, or did not otherwise contain valid data. It has been removed, so you can re-run your command now."%cachefile)
raiseAnsibleError("The cache file %s was corrupt, or did not otherwise contain valid data."
" It has been removed, so you can re-run your command now."%cachefile)
except(OSError,IOError)ase:
except(OSError,IOError)ase:
display.warning("error in '%s' cache plugin while trying to read %s : %s"%(self.plugin_name,cachefile,to_bytes(e)))
display.warning("error in '%s' cache plugin while trying to read %s : %s"%(self.plugin_name,cachefile,to_bytes(e)))
raiseKeyError
raiseKeyError
@ -132,17 +129,9 @@ class BaseFileCacheModule(BaseCacheModule):