Skip to content

Commit

Permalink
fix: Ignore errors when touching jinja2 cache files
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Oct 11, 2021
1 parent a2a9b2f commit 504a8c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kluctl/utils/jinja2_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ def touch_loaded_marker(self, bucket):
filename = self._get_cache_filename(bucket) + ".loaded"
if filename in self.did_touch:
return
with open(filename + ".tmp", mode="wt") as f:
f.write(str(datetime.utcnow()))
try:
with open(filename + ".tmp", mode="wt") as f:
f.write(str(datetime.utcnow()))
os.rename(filename + ".tmp", filename)
except:
# Failure here it "ok" and is mostly happening on Windows here (permission denied for opened files...ugh..)
pass
self.did_touch.add(filename)

Expand Down

0 comments on commit 504a8c5

Please sign in to comment.