Package: calendarserver
Version: 1.2.dfsg-6

Hi,

it would appear that apache.BasicDirectoryService is difficult to get to
work.
Note that the two parts might best be applied separately.
In config.py, parts of the code seem to explicitly cater for
non-preconfigured DirectoryServices, while the two the patch is changing
are not. (You possibly had similar a similar problem for the
NssDirectoryService.)
The second part moves the apache DirectoryServices to the
configured-via-keyword-args scheme. Naturally, the two assertions could
be replaced by checks with prettier exceptions to be raised for failures.
I did briefly join #calendarserver on freenode, but noone seemed to be
around when I asked about what is up with the apache DirectoryServices.

Kind regards

T.
-- 
Thomas Viehmann, http://thomas.viehmann.net/
--- twistedcaldav/config.py	2008-10-27 21:55:00.000000000 +0100
+++ /usr/share/pyshared/twistedcaldav/config.py	2008-10-27 21:02:40.000000000 +0100
@@ -218,14 +218,15 @@
                     self._data["DirectoryService"]["params"] = {}
 
         for param in items.get("DirectoryService", {}).get("params", {}):
-            if param not in serviceDefaultParams[dsType]:
+            if dsType in serviceDefaultParams and param not in serviceDefaultParams[dsType]:
                 raise ConfigurationError("Parameter %s is not supported by service %s" % (param, dsType))
 
         _mergeData(self._data, items)
 
-        for param in tuple(self._data["DirectoryService"]["params"]):
-            if param not in serviceDefaultParams[self._data["DirectoryService"]["type"]]:
-                del self._data["DirectoryService"]["params"][param]
+        if self._data["DirectoryService"]["type"] in serviceDefaultParams:
+            for param in tuple(self._data["DirectoryService"]["params"]):
+                if param not in serviceDefaultParams[self._data["DirectoryService"]["type"]]:
+                    del self._data["DirectoryService"]["params"][param]
 
         self.updateServerCapabilities()
 
--- twistedcaldav/directory/apache.py	2008-04-20 17:12:01.000000000 +0200
+++ /usr/share/pyshared/twistedcaldav/directory/apache.py	2008-10-27 21:57:28.000000000 +0100
@@ -40,7 +40,9 @@
     def __repr__(self):
         return "<%s %r: %r %r>" % (self.__class__.__name__, self.realmName, self.userFile, self.groupFile)
 
-    def __init__(self, realmName, userFile, groupFile=None):
+    def __init__(self, realmName=None, userFile=None, groupFile=None):
+        assert realmName
+        assert userFile
         super(AbstractDirectoryService, self).__init__()
 
         if type(userFile) is str:

Reply via email to