[CalendarServer-changes] [7089] CalendarServer/trunk/contrib/migration
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 1 11:36:06 PST 2011
Revision: 7089
http://trac.macosforge.org/projects/calendarserver/changeset/7089
Author: sagen at apple.com
Date: 2011-03-01 11:36:06 -0800 (Tue, 01 Mar 2011)
Log Message:
-----------
Addresses situation where SSL had never been enabled on calendar or addressbook server prior to migration
Modified Paths:
--------------
CalendarServer/trunk/contrib/migration/calendarmigrator.py
CalendarServer/trunk/contrib/migration/test/test_migrator.py
Modified: CalendarServer/trunk/contrib/migration/calendarmigrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarmigrator.py 2011-03-01 16:28:10 UTC (rev 7088)
+++ CalendarServer/trunk/contrib/migration/calendarmigrator.py 2011-03-01 19:36:06 UTC (rev 7089)
@@ -405,12 +405,12 @@
del combined["DirectoryService"]["params"][key]
# Merge ports
- if not caldav["SSLPort"]:
+ if not caldav.get("SSLPort", 0):
caldav["SSLPort"] = 8443
- if not carddav["SSLPort"]:
+ if not carddav.get("SSLPort", 0):
carddav["SSLPort"] = 8843
for portType in ["HTTPPort", "SSLPort"]:
- bindPorts = list(set(caldav["Bind%ss" % (portType,)]).union(set(carddav["Bind%ss" % (portType,)])))
+ bindPorts = list(set(caldav.get("Bind%ss" % (portType,), [])).union(set(carddav.get("Bind%ss" % (portType,), []))))
if caldav[portType] and caldav[portType] not in bindPorts:
bindPorts.append(caldav[portType])
if carddav[portType] and carddav[portType] not in bindPorts:
Modified: CalendarServer/trunk/contrib/migration/test/test_migrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/test/test_migrator.py 2011-03-01 16:28:10 UTC (rev 7088)
+++ CalendarServer/trunk/contrib/migration/test/test_migrator.py 2011-03-01 19:36:06 UTC (rev 7089)
@@ -205,4 +205,37 @@
self.assertEquals(newCombined, expected)
+ # Never had SSL enabled, so missing SSLPort
+ oldCalDAV = {
+ "BindHTTPPorts": [],
+ "HTTPPort": 8008,
+ "RedirectHTTPToHTTPS": False,
+ "SSLAuthorityChain": "",
+ "SSLCertificate": "",
+ "SSLPrivateKey": "",
+ }
+ oldCardDAV = {
+ "BindHTTPPorts": [],
+ "HTTPPort": 8800,
+ "RedirectHTTPToHTTPS": False,
+ "SSLAuthorityChain": "",
+ "SSLCertificate": "",
+ "SSLPrivateKey": "",
+ }
+ expected = {
+ "BindHTTPPorts": [8008, 8800],
+ "BindSSLPorts": [8443, 8843],
+ "EnableSSL" : False,
+ "HTTPPort": 8008,
+ "RedirectHTTPToHTTPS": False,
+ "SSLAuthorityChain": "",
+ "SSLCertificate": "",
+ "SSLPort": 8443,
+ "SSLPrivateKey": "",
+ }
+ newCombined = { }
+ mergePlist(oldCalDAV, oldCardDAV, newCombined)
+ self.assertEquals(newCombined, expected)
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110301/898647a9/attachment-0001.html>
More information about the calendarserver-changes
mailing list