Diff
Modified: CalendarServer/trunk/twistedcaldav/index.py (1519 => 1520)
--- CalendarServer/trunk/twistedcaldav/index.py 2007-05-08 20:25:09 UTC (rev 1519)
+++ CalendarServer/trunk/twistedcaldav/index.py 2007-05-09 00:52:38 UTC (rev 1520)
@@ -95,6 +95,12 @@
"""
self.resource = resource
+ def create(self):
+ """
+ Create the index and initialize it.
+ """
+ self._db()
+
def reserveUID(self, uid):
"""
Reserve a UID for this index's resource.
Modified: CalendarServer/trunk/twistedcaldav/static.py (1519 => 1520)
--- CalendarServer/trunk/twistedcaldav/static.py 2007-05-08 20:25:09 UTC (rev 1519)
+++ CalendarServer/trunk/twistedcaldav/static.py 2007-05-09 00:52:38 UTC (rev 1520)
@@ -132,6 +132,10 @@
# Initialize CTag on the calendar collection
self.writeDeadProperty(customxml.GETCTag(str(datetime.datetime.now())))
+
+ # Create the index so its ready when the first PUTs come in
+ self.index().create()
+
return status
d = self.createSpecialCollection(davxml.ResourceType.calendar)
Modified: CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py (1519 => 1520)
--- CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py 2007-05-08 20:25:09 UTC (rev 1519)
+++ CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py 2007-05-09 00:52:38 UTC (rev 1520)
@@ -17,6 +17,7 @@
##
from twisted.internet.defer import waitForDeferred
from twisted.internet.defer import deferredGenerator
+from twistedcaldav import index
import os
@@ -63,6 +64,9 @@
self.fail("Incorrect response to successful MKCALENDAR: %s"
% (response.code,))
+ if not os.path.exists(os.path.join(path, index.db_basename)):
+ self.fail("Did not create index file when creating a calendar")
+
request = SimpleRequest(self.site, "MKCALENDAR", uri)
return self.send(request, do_test)