Skip to content

Commit

Permalink
Common: ResourceCache: Workaround issue LNST-project#189
Browse files Browse the repository at this point in the history
Workaround the issue of non existing cache entry when trying to delete.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
  • Loading branch information
yotamgi authored and Yuval Mintz committed Oct 30, 2017
1 parent 5ef5747 commit 769a505
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lnst/Common/ResourceCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def add_cache_entry(self, entry_hash, filepath, entry_name, entry_type):

def del_cache_entry(self, entry_hash):
if entry_hash in self._entries:
shutil.rmtree("%s/%s" % (self._root, entry_hash))
try:
shutil.rmtree("%s/%s" % (self._root, entry_hash))
except OSError as e:
if e.errno != 2:
raise
del self._entries[entry_hash]
self._save_index()

Expand Down

0 comments on commit 769a505

Please sign in to comment.