[CalendarServer-changes] [11024] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 10 09:10:31 PDT 2013


Revision: 11024
          http://trac.calendarserver.org//changeset/11024
Author:   sagen at apple.com
Date:     2013-04-10 09:10:31 -0700 (Wed, 10 Apr 2013)
Log Message:
-----------
Remove obsolete V1Compatibility mode

Modified Paths:
--------------
    CalendarServer/trunk/conf/caldavd-test.plist
    CalendarServer/trunk/twistedcaldav/ical.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/twistedcaldav/test/test_icalendar.py
    CalendarServer/trunk/twistedcaldav/util.py

Modified: CalendarServer/trunk/conf/caldavd-test.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd-test.plist	2013-04-10 03:14:09 UTC (rev 11023)
+++ CalendarServer/trunk/conf/caldavd-test.plist	2013-04-10 16:10:31 UTC (rev 11024)
@@ -772,8 +772,6 @@
         <false/>
         <key>AttendeeRefreshBatch</key>
         <integer>0</integer>
-        <key>V1Compatibility</key> <!-- Allow /path-based CUAs in scheduling replies -->
-        <false/>
 
 		<key>AutoSchedule</key>
 		<dict>

Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2013-04-10 03:14:09 UTC (rev 11023)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2013-04-10 16:10:31 UTC (rev 11024)
@@ -2994,26 +2994,13 @@
                 cutype = prop.parameterValue("CUTYPE")
 
                 if toUUID:
-                    # Store the original CUA if http(s) or /path:
-                    if config.Scheduling.Options.V1Compatibility:
-                        if cuaddr.startswith("http") or cuaddr.startswith("/"):
-                            prop.setParameter("CALENDARSERVER-OLD-CUA",
-                                "base64-%s" % (base64.b64encode(prop.value())))
-
                     # Always re-write value to urn:uuid
                     prop.setValue("urn:uuid:%s" % (guid,))
 
                 # If it is already a non-UUID address leave it be
                 elif cuaddr.startswith("urn:uuid:"):
 
-                    # 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:
+                    if oldemail:
                         # Use the EMAIL parameter if it exists
                         newaddr = oldemail
                     else:

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2013-04-10 03:14:09 UTC (rev 11023)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2013-04-10 16:10:31 UTC (rev 11024)
@@ -704,7 +704,6 @@
             "AttendeeRefreshBatchIntervalSeconds" : 5, # Time between attendee batch refreshes
             "UIDLockTimeoutSeconds"               : 60, # Time for implicit UID lock timeout
             "UIDLockExpirySeconds"                : 300, # Expiration time for UID lock,
-            "V1Compatibility"                     : False, # Allow /path-based CUAs in scheduling replies
             "PrincipalHostAliases"                : [], # Host names matched in http(s) CUAs
             "TimestampAttendeePartStatChanges"    : True, # Add a time stamp when an Attendee changes their PARTSTAT
 

Modified: CalendarServer/trunk/twistedcaldav/test/test_icalendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_icalendar.py	2013-04-10 03:14:09 UTC (rev 11023)
+++ CalendarServer/trunk/twistedcaldav/test/test_icalendar.py	2013-04-10 16:10:31 UTC (rev 11024)
@@ -7323,7 +7323,6 @@
     def test_normalizeCalendarUserAddressesFromUUID(self):
         """
         Ensure mailto is preferred, followed by path form, then http form.
-        If CALENDARSERVER-OLD-CUA parameter is present, restore that value.
         """
 
         data = """BEGIN:VCALENDAR
@@ -7335,7 +7334,6 @@
 ATTENDEE:urn:uuid:foo
 ATTENDEE:urn:uuid:bar
 ATTENDEE:urn:uuid:baz
-ATTENDEE;CALENDARSERVER-OLD-CUA="base64-aHR0cDovL2V4YW1wbGUuY29tL3ByaW5jaXBhbHMvdXNlcnMvYnV6":urn:uuid:buz
 DTSTAMP:20071114T000000Z
 END:VEVENT
 END:VCALENDAR
@@ -7361,11 +7359,6 @@
                     "baz",
                     ("urn:uuid:baz", "http://example.com/baz")
                 ),
-                "urn:uuid:buz" : (
-                    "Buz",
-                    "buz",
-                    ("urn:uuid:buz",)
-                ),
             }[cuaddr]
 
         component.normalizeCalendarUserAddresses(lookupFunction, None, toUUID=False)
@@ -7376,62 +7369,10 @@
             component.getAttendeeProperty(("/foo",)).value())
         self.assertEquals("http://example.com/baz",
             component.getAttendeeProperty(("http://example.com/baz",)).value())
-        self.assertEquals("http://example.com/principals/users/buz",
-            component.getAttendeeProperty(("http://example.com/principals/users/buz",)).value())
 
 
-    def test_normalizeCalendarUserAddressesToUUID(self):
-        """
-        Ensure http(s) and /path CUA values are tucked away into the property
-        using CALENDARSERVER-OLD-CUA parameter.
-        """
 
-        data = """BEGIN:VCALENDAR
-VERSION:2.0
-DTSTART:20071114T000000Z
-BEGIN:VEVENT
-UID:12345-67890
-DTSTART:20071114T000000Z
-ATTENDEE:/principals/users/foo
-ATTENDEE:http://example.com/principals/users/buz
-DTSTAMP:20071114T000000Z
-END:VEVENT
-END:VCALENDAR
-"""
 
-        component = Component.fromString(data)
-
-
-        def lookupFunction(cuaddr, ignored1, ignored2):
-            return {
-                "/principals/users/foo" : (
-                    "Foo",
-                    "foo",
-                    ("urn:uuid:foo",)
-                ),
-                "http://example.com/principals/users/buz" : (
-                    "Buz",
-                    "buz",
-                    ("urn:uuid:buz",)
-                ),
-            }[cuaddr]
-
-        self.patch(config.Scheduling.Options, "V1Compatibility", True)
-        component.normalizeCalendarUserAddresses(lookupFunction, None, toUUID=True)
-
-        # /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"),
-            "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"),
-            "base64-aHR0cDovL2V4YW1wbGUuY29tL3ByaW5jaXBhbHMvdXNlcnMvYnV6")
-
-
     def test_normalizeCalendarUserAddressesAndLocationChange(self):
         """
         Ensure http(s) and /path CUA values are tucked away into the property

Modified: CalendarServer/trunk/twistedcaldav/util.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/util.py	2013-04-10 03:14:09 UTC (rev 11023)
+++ CalendarServer/trunk/twistedcaldav/util.py	2013-04-10 16:10:31 UTC (rev 11024)
@@ -464,11 +464,6 @@
         # to single-quotes.
         fullName = rec.fullName.replace('"', "'")
 
-        # TODO: remove V1Compatibility when V1 migration is complete
-        if config.Scheduling.Options.V1Compatibility:
-            # Allow /principals-form CUA
-            cuas = principal.calendarUserAddresses()
-        else:
-            cuas = principal.record.calendarUserAddresses
+        cuas = principal.record.calendarUserAddresses
 
         return (fullName, rec.guid, cuas)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130410/c8af1e3c/attachment.html>


More information about the calendarserver-changes mailing list