[CalendarServer-changes] [1597] CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 7 11:22:04 PDT 2007


Revision: 1597
          http://trac.macosforge.org/projects/calendarserver/changeset/1597
Author:   dreid at apple.com
Date:     2007-06-07 11:22:03 -0700 (Thu, 07 Jun 2007)

Log Message:
-----------
Fix the on demand od lookup during a cache miss.  Handle servers that are broken.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py

Modified: CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2007-06-07 17:09:37 UTC (rev 1596)
+++ CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2007-06-07 18:22:03 UTC (rev 1597)
@@ -411,7 +411,7 @@
                                          % (recordType,))
 
         if self.requireComputerRecord:
-            subquery = dsquery.match(dsattributes.kDSNAttrServicesLocator, self.servicetag, dsattributes.eDSStartsWith)
+            subquery = dsquery.match(dsattributes.kDSNAttrServicesLocator, self.servicetag, dsattributes.eDSExact)
             if query is None:
                 query = subquery
             else:
@@ -458,21 +458,12 @@
 
         for (key, value) in results.iteritems():
             if self.requireComputerRecord:
-                # Make sure this record has service enabled.
-                enabled = True
-
                 services = value.get(dsattributes.kDSNAttrServicesLocator)
-                if isinstance(services, str):
-                    services = [services]
 
-                for service in services:
-                    if service.startswith(self.servicetag):
-                        if service.endswith(":disabled"):
-                            enabled = False
-                        break
-
-                if not enabled:
-                    log.err("Record is not enabled")
+                if not services:
+                    log.err("No ServicesLocator attribute: %s" % (key,))
+                    log.err("The ServicesLocator attribute was requested in query.  "
+                            "Your directory server appears to be broken.")
                     continue
 
             # Now get useful record info.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070607/52ed386a/attachment.html


More information about the calendarserver-changes mailing list