[CalendarServer-changes] [5529] CalendarServer/trunk/calendarserver/tap/util.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 26 09:56:20 PDT 2010


Revision: 5529
          http://trac.macosforge.org/projects/calendarserver/changeset/5529
Author:   cdaboo at apple.com
Date:     2010-04-26 09:56:14 -0700 (Mon, 26 Apr 2010)
Log Message:
-----------
Fix race-condition causing unnecessary error log entries during global address book provisioning.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2010-04-23 19:08:21 UTC (rev 5528)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2010-04-26 16:56:14 UTC (rev 5529)
@@ -310,8 +310,16 @@
                 principalCollections=(principalCollection,)
             )
             if not globalAddressBookCollection.exists():
-                addSystemEventTrigger("after", "startup", globalAddressBookCollection.createAddressBookCollection)
+                def createGlobalAddressBookIgnoreException():
+                    try:
+                        if not globalAddressBookCollection.exists():
+                            globalAddressBookCollection.createAddressBookCollection()
+                    except OSError, e:
+                        if e.errno != errno.EEXIST:
+                            raise
 
+                addSystemEventTrigger("after", "startup", createGlobalAddressBookIgnoreException)
+
     log.info("Setting up root resource: %r" % (rootResourceClass,))
 
     root = rootResourceClass(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100426/2fb4a14b/attachment.html>


More information about the calendarserver-changes mailing list