Revision: 9281 http://trac.macosforge.org/projects/calendarserver/changeset/9281 Author: glyph@apple.com Date: 2012-05-24 13:33:55 -0700 (Thu, 24 May 2012) Log Message: ----------- fix up group name upgrader to be compatible with tests Modified Paths: -------------- CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/calendaruserproxy.py Modified: CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/calendaruserproxy.py =================================================================== --- CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/calendaruserproxy.py 2012-05-24 20:33:52 UTC (rev 9280) +++ CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/calendaruserproxy.py 2012-05-24 20:33:55 UTC (rev 9281) @@ -800,15 +800,15 @@ ) if int(old_version) < 5: - for groupname, member in ( - (yield self.query("select GROUPNAME, MEMBER from GROUPS")) + for (groupname, member) in ( + (yield self._db_all_values_for_sql("select GROUPNAME, MEMBER from GROUPS")) ): - groupPrincipalUID, groupMode = groupname.split("#") + grouplist = groupname.split("#") + grouplist[0] = normalizeUUID(grouplist[0]) yield self._db_execute(""" - update GROUPS set (GROUPNAME = :1, MEMBER = :2) + update GROUPS set GROUPNAME = :1, MEMBER = :2 where GROUPNAME = :1 and MEMBER = :2 - """, "#".join([normalizeUUID(groupPrincipalUID), groupMode]), - normalizeUUID(member)) + """, ["#".join(grouplist), normalizeUUID(member)]) def _db_empty_data_tables(self):