Skip to content
Snippets Groups Projects
Commit 007406da authored by Brian Moe's avatar Brian Moe
Browse files

Fix issue #692, broken symlinks on cluster fs

parent 8d166754
No related branches found
No related tags found
No related merge requests found
......@@ -126,10 +126,12 @@ class VersionedFile(file):
try:
# XXX Another race condition. File will not exist for a very brief time.
os.unlink(self.fullname)
except:
# Do not care if file does not exist.
pass
os.symlink(self._name_for_version(last_version), self.fullname)
except OSError, e:
# Do not care if file does not exist, otherwise raise exception.
if e.errno != errno.ENOENT:
raise
name = os.path.basename(self._name_for_version(last_version))
os.symlink(name, self.fullname)
return
# XXX This fails when renaming/mv-ing across devices.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment