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 <[email protected]>
  • Loading branch information
yotamgi committed Sep 14, 2017
1 parent 910d7d8 commit 5148229
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 5148229

Please sign in to comment.