[CalendarServer-changes] [8019] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 25 18:03:19 PDT 2011


Revision: 8019
          http://trac.macosforge.org/projects/calendarserver/changeset/8019
Author:   cdaboo at apple.com
Date:     2011-08-25 18:03:19 -0700 (Thu, 25 Aug 2011)
Log Message:
-----------
Allow different prop stores to be configured on the root resource as some systems won't support
native xattrs.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/provision/root.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py

Modified: CalendarServer/trunk/calendarserver/provision/root.py
===================================================================
--- CalendarServer/trunk/calendarserver/provision/root.py	2011-08-26 00:08:27 UTC (rev 8018)
+++ CalendarServer/trunk/calendarserver/provision/root.py	2011-08-26 01:03:19 UTC (rev 8019)
@@ -23,10 +23,12 @@
 from twext.web2 import responsecode
 from twext.web2.auth.wrapper import UnauthorizedResponse
 from twext.web2.dav import davxml
+from twext.web2.dav.xattrprops import xattrPropertyStore
 from twext.web2.http import HTTPError, StatusResponse, RedirectResponse
 
 from twisted.cred.error import LoginFailed, UnauthorizedLogin
 from twisted.internet.defer import inlineCallbacks, returnValue
+from twisted.python.reflect import namedClass
 from twisted.web.xmlrpc import Proxy
 
 from twistedcaldav.cache import _CachedResponseResource
@@ -108,10 +110,11 @@
     def deadProperties(self):
         if not hasattr(self, "_dead_properties"):
             # Get the property store from super
-            deadProperties = super(RootResource, self).deadProperties()
+            deadProperties = namedClass(config.RootResourcePropStoreClass)(self)
 
             # Wrap the property store in a memory store
-            deadProperties = CachingPropertyStore(deadProperties)
+            if isinstance(deadProperties, xattrPropertyStore):
+                deadProperties = CachingPropertyStore(deadProperties)
 
             self._dead_properties = deadProperties
 

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2011-08-26 00:08:27 UTC (rev 8018)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2011-08-26 01:03:19 UTC (rev 8019)
@@ -796,6 +796,9 @@
     # version which uses OpenDirectory.framework
     "OpenDirectoryModule": "opendirectory",
 
+    # The RootResource uses a twext property store. Specify the class here
+    "RootResourcePropStoreClass": "twext.web2.dav.xattrprops.xattrPropertyStore",
+
     # Used in the command line utilities to specify which service class to
     # use to carry out work.
     "UtilityServiceClass": "",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110825/aca37204/attachment.html>


More information about the calendarserver-changes mailing list