diff options
author | Brian Coca <bcoca@ansible.com> | 2015-05-01 14:17:35 -0400 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2015-05-01 14:17:35 -0400 |
commit | c926bb683a43e4d5beafc20d5a132d1a96b8911c (patch) | |
tree | 48da9e1fe9222a2ef60a1b3061efd51a4a848f86 | |
parent | 108a1e153a633dd4eabf5c7023e9c334ae442acf (diff) | |
parent | 8d324e6a50459641fb654e4b921ebb8418a6643d (diff) | |
download | ansible-c926bb683a43e4d5beafc20d5a132d1a96b8911c.tar.gz |
Merge pull request #10901 from mscherer/fix_var_not_exist
Fix pylint error on "cachefile does not exist"
-rw-r--r-- | lib/ansible/cache/jsonfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/cache/jsonfile.py b/lib/ansible/cache/jsonfile.py index 9c45dc22fd..0bade893a8 100644 --- a/lib/ansible/cache/jsonfile.py +++ b/lib/ansible/cache/jsonfile.py @@ -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: |