[CalendarServer-changes] [12623] twext/trunk/twext/who/ldap/_service.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:24:24 PDT 2014
Revision: 12623
http://trac.calendarserver.org//changeset/12623
Author: sagen at apple.com
Date: 2014-02-08 14:54:32 -0800 (Sat, 08 Feb 2014)
Log Message:
-----------
LDAP recordTypeForRecordData needs to take into account multiple values for objectClass
Modified Paths:
--------------
twext/trunk/twext/who/ldap/_service.py
Modified: twext/trunk/twext/who/ldap/_service.py
===================================================================
--- twext/trunk/twext/who/ldap/_service.py 2014-02-08 22:34:30 UTC (rev 12622)
+++ twext/trunk/twext/who/ldap/_service.py 2014-02-08 22:54:32 UTC (rev 12623)
@@ -506,8 +506,16 @@
for recordType, schema in recordTypeSchemas.iteritems():
for attribute, value in schema.attributes:
- if recordData.get(attribute) != value:
- break
+ dataValue = recordData.get(attribute)
+ # If the data value (e.g. objectClass) is a list, see if the
+ # expected value is contained in that list, otherwise directly
+ # compare.
+ if isinstance(dataValue, list):
+ if value not in dataValue:
+ break
+ else:
+ if value != dataValue:
+ break
else:
return recordType
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/e1c680ab/attachment.html>
More information about the calendarserver-changes
mailing list