[CalendarServer-changes] [12715] CalendarServer/trunk/txdav/caldav/datastore/sql.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:22:44 PDT 2014
Revision: 12715
http://trac.calendarserver.org//changeset/12715
Author: cdaboo at apple.com
Date: 2014-02-17 10:16:35 -0800 (Mon, 17 Feb 2014)
Log Message:
-----------
Don't fail if new attachment hashed directory already exists.
Modified Paths:
--------------
CalendarServer/trunk/txdav/caldav/datastore/sql.py
Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py 2014-02-17 18:15:54 UTC (rev 12714)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py 2014-02-17 18:16:35 UTC (rev 12715)
@@ -4364,7 +4364,12 @@
raise AttachmentMigrationFailed
# Then move the file on disk from the old path to the new one
- mattach._path.parent().makedirs()
+ try:
+ mattach._path.parent().makedirs()
+ except Exception:
+ # OK to fail if it already exists, otherwise must raise
+ if not mattach._path.parent().exists():
+ raise
oldpath = self._path
newpath = mattach._path
oldpath.moveTo(newpath)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/88f139cc/attachment.html>
More information about the calendarserver-changes
mailing list