I think this is a bug, and I have a fix, but I am not sure if it is in
the "right" place.  Anyhow this allows calendarserver to at least to
populate the Group Membership Cache in memcache.  And start up the
network listeners.

I am now seeing other issues with starting the group caching service, so
maybe this does not actually fix the problem.

The two attached files are the patches, directory-4.2-20130208.patch
against the 4.2 branch and directory-main-20130208.patch against the
main development branch (checked out today).

-Dennison

On 01/30/2013 11:42 PM, Dennison Williams wrote:
> On 01/30/2013 10:53 PM, Glyph wrote:
>>
>> On Jan 30, 2013, at 8:06 PM, Dennison Williams
>> <dennison.willi...@gmail.com <mailto:dennison.willi...@gmail.com>> wrote:
>>
>>> Tracing this all the way up the stack I see tha the getGroups method
>>> receives a guid value of  set([None]), but this is not caught as I think
>>> maybe it should be on line 675
>>>
>>> if guids is None:
>>>
>>> But because I am not super familar with this application and have
>>> limited familiarity with python I am not sure if this indicates an issue
>>> with my config, my environment, or the code.
>>
>> The LDAP directory is incredibly flexible, and can be coerced to do
>> various insane things by setting up mappings incorrectly.  Having a copy
>> of your caldavd.plist would be helpful when diagnosing this error.
>>  (Actually having a copy of your entire directory along with that would
>> be even more useful, but I presume that isn't possible ;-)).
> 
> Please see attached my caldavd.plist.  I could also send a few sections
> from an ldapsearch query if that was helpful
>>
>> -glyph
> 

--- /usr/local/lib/python2.7/dist-packages/twistedcaldav/directory/directory.py	2013-02-08 14:37:02.000000000 -0800
+++ /opt/CalendarServer-4.2/twistedcaldav/directory/directory.py	2013-02-04 10:09:37.000000000 -0800
@@ -640,7 +640,7 @@ class GroupMembershipCacheUpdater(Loggin
         groups = {}
         aliases = {}
 
-        if guids is None or (type(guids) == set and None in guids): # get all group guids
+        if guids is None: # get all group guids
             records = self.directory.listRecords(self.directory.recordType_groups)
         else: # get only the ones we know have been delegated to
             records = (yield self.directory.getGroups(guids))
--- /opt/CalendarServer/CalendarServer/twistedcaldav/directory/directory.py	2013-02-08 14:47:40.000000000 -0800
+++ /opt/CalendarServer/CalendarServer/twistedcaldav/directory/directory-fix.py	2013-02-08 14:49:16.000000000 -0800
@@ -672,7 +672,7 @@ class GroupMembershipCacheUpdater(Loggin
         groups = {}
         aliases = {}
 
-        if guids is None: # get all group guids
+        if guids is None or (type(guids) == set and None in guids): # get all group guids
             records = self.directory.listRecords(self.directory.recordType_groups)
         else: # get only the ones we know have been delegated to
             records = (yield self.directory.getGroups(guids))
_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/calendarserver-dev

Reply via email to