1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #10901 from mscherer/fix_var_not_exist

Fix pylint error on "cachefile does not exist"
This commit is contained in:
Brian Coca 2015-05-01 14:17:35 -04:00
commit c926bb683a

View file

@ -108,6 +108,7 @@ class CacheModule(BaseCacheModule):
return keys
def contains(self, key):
cachefile = "%s/%s" % (self._cache_dir, key)
if key in self._cache:
return True
@ -115,7 +116,7 @@ class CacheModule(BaseCacheModule):
if self.has_expired(key):
return False
try:
st = os.stat("%s/%s" % (self._cache_dir, key))
st = os.stat(cachefile)
return True
except (OSError,IOError), e:
if e.errno == errno.ENOENT: