[CalendarServer-changes] [9178] CalendarServer/branches/users/sagen/d3/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 24 09:19:22 PDT 2012


Revision: 9178
          http://trac.macosforge.org/projects/calendarserver/changeset/9178
Author:   sagen at apple.com
Date:     2012-04-24 09:19:22 -0700 (Tue, 24 Apr 2012)
Log Message:
-----------
Bring up r9117 from trunk -- the CALENDARSERVER-OLD-CUA base64 fix.

Revision Links:
--------------
    http://trac.macosforge.org/projects/calendarserver/changeset/9117

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/d3/twistedcaldav/ical.py
    CalendarServer/branches/users/sagen/d3/twistedcaldav/test/test_icalendar.py

Modified: CalendarServer/branches/users/sagen/d3/twistedcaldav/ical.py
===================================================================
--- CalendarServer/branches/users/sagen/d3/twistedcaldav/ical.py	2012-04-24 16:13:07 UTC (rev 9177)
+++ CalendarServer/branches/users/sagen/d3/twistedcaldav/ical.py	2012-04-24 16:19:22 UTC (rev 9178)
@@ -56,6 +56,8 @@
 from pycalendar.timezone import PyCalendarTimezone
 from pycalendar.utcoffsetvalue import PyCalendarUTCOffsetValue
 
+import base64
+
 log = Logger()
 
 iCalendarProductID = "-//CALENDARSERVER.ORG//NONSGML Version 1//EN"
@@ -2577,7 +2579,7 @@
                     if config.Scheduling.Options.V1Compatibility:
                         if cuaddr.startswith("http") or cuaddr.startswith("/"):
                             prop.setParameter("CALENDARSERVER-OLD-CUA",
-                                prop.value())
+                                "base64-%s" % (base64.b64encode(prop.value())))
 
                     # Always re-write value to urn:uuid
                     prop.setValue("urn:uuid:%s" % (guid,))
@@ -2588,6 +2590,8 @@
                     # Restore old CUA
                     oldExternalCUA = prop.parameterValue("CALENDARSERVER-OLD-CUA")
                     if oldExternalCUA:
+                        if oldExternalCUA.startswith("base64-"):
+                            oldExternalCUA = base64.b64decode(oldExternalCUA[7:])
                         newaddr = oldExternalCUA
                         prop.removeParameter("CALENDARSERVER-OLD-CUA")
                     elif oldemail:

Modified: CalendarServer/branches/users/sagen/d3/twistedcaldav/test/test_icalendar.py
===================================================================
--- CalendarServer/branches/users/sagen/d3/twistedcaldav/test/test_icalendar.py	2012-04-24 16:13:07 UTC (rev 9177)
+++ CalendarServer/branches/users/sagen/d3/twistedcaldav/test/test_icalendar.py	2012-04-24 16:19:22 UTC (rev 9178)
@@ -5993,7 +5993,7 @@
 ATTENDEE:urn:uuid:foo
 ATTENDEE:urn:uuid:bar
 ATTENDEE:urn:uuid:baz
-ATTENDEE;CALENDARSERVER-OLD-CUA="http://example.com/principals/users/buz":urn:uuid:buz
+ATTENDEE;CALENDARSERVER-OLD-CUA="base64-aHR0cDovL2V4YW1wbGUuY29tL3ByaW5jaXBhbHMvdXNlcnMvYnV6":urn:uuid:buz
 DTSTAMP:20071114T000000Z
 END:VEVENT
 END:VCALENDAR
@@ -6075,17 +6075,17 @@
         self.patch(config.Scheduling.Options, "V1Compatibility", True)
         component.normalizeCalendarUserAddresses(lookupFunction, None, toUUID=True)
 
-        # /principal CUAs are not stored in CALENDARSERVER-OLD-CUA
+        # /principal CUAs are stored in CALENDARSERVER-OLD-CUA
         prop = component.getAttendeeProperty(("urn:uuid:foo",))
         self.assertEquals("urn:uuid:foo", prop.value())
         self.assertEquals(prop.parameterValue("CALENDARSERVER-OLD-CUA"),
-            "/principals/users/foo")
+            "base64-L3ByaW5jaXBhbHMvdXNlcnMvZm9v")
 
         # http CUAs are stored in CALENDARSERVER-OLD-CUA
         prop = component.getAttendeeProperty(("urn:uuid:buz",))
         self.assertEquals("urn:uuid:buz", prop.value())
         self.assertEquals(prop.parameterValue("CALENDARSERVER-OLD-CUA"),
-            "http://example.com/principals/users/buz")
+            "base64-aHR0cDovL2V4YW1wbGUuY29tL3ByaW5jaXBhbHMvdXNlcnMvYnV6")
 
 
     def test_serializationCaching(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120424/572b442c/attachment-0001.html>


More information about the calendarserver-changes mailing list