[CalendarServer-changes] [950] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jan 5 14:30:21 PST 2007
Revision: 950
http://trac.macosforge.org/projects/calendarserver/changeset/950
Author: dreid at apple.com
Date: 2007-01-05 14:30:21 -0800 (Fri, 05 Jan 2007)
Log Message:
-----------
Merge users/dreid/principalsOnDemand-114-2 so that we don't provision anything before dropping privileges.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/directory/principal.py
CalendarServer/trunk/twistedcaldav/test/test_root.py
Modified: CalendarServer/trunk/twistedcaldav/directory/principal.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/principal.py 2007-01-05 22:28:33 UTC (rev 949)
+++ CalendarServer/trunk/twistedcaldav/directory/principal.py 2007-01-05 22:30:21 UTC (rev 950)
@@ -79,10 +79,6 @@
# FIXME: Smells like a hack
directory.principalCollection = self
- # Provision in __init__() because principals are used prior to request
- # lookups.
- self.provision()
-
# Create children
for recordType in self.directory.recordTypes():
self.putChild(recordType, DirectoryPrincipalTypeResource(self.fp.child(recordType).path, self, recordType))
@@ -140,6 +136,7 @@
raise HTTPError(responsecode.NOT_FOUND)
def getChild(self, name):
+ self.provision()
return self.putChildren.get(name, None)
def listChildren(self):
@@ -174,10 +171,6 @@
self.recordType = recordType
self.parent = parent
- # Provision in __init__() because principals are used prior to request
- # lookups.
- self.provision()
-
def principalForUser(self, user):
return self.parent.principalForUser(user)
@@ -196,6 +189,7 @@
raise HTTPError(responsecode.NOT_FOUND)
def getChild(self, name, record=None):
+ self.provision()
if name == "":
return self
Modified: CalendarServer/trunk/twistedcaldav/test/test_root.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_root.py 2007-01-05 22:28:33 UTC (rev 949)
+++ CalendarServer/trunk/twistedcaldav/test/test_root.py 2007-01-05 22:30:21 UTC (rev 950)
@@ -67,6 +67,10 @@
'/principals/',
directory)
+ # Otherwise the tests that never touch the root resource will
+ # fail on teardown.
+ principals.provision()
+
root = RootResource(self.docroot,
principalCollections=[principals])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070105/7415a2dc/attachment.html
More information about the calendarserver-changes
mailing list