[CalendarServer-changes] [8878] CalendarServer/trunk/contrib/migration

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 15 15:31:19 PDT 2012


Revision: 8878
          http://trac.macosforge.org/projects/calendarserver/changeset/8878
Author:   sagen at apple.com
Date:     2012-03-15 15:31:19 -0700 (Thu, 15 Mar 2012)
Log Message:
-----------
Disable XMPPNotifier during migration/promotion, now that we're talking directly to APNS.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/migration/calendarmigrator.py
    CalendarServer/trunk/contrib/migration/calendarpromotion.py
    CalendarServer/trunk/contrib/migration/test/test_migrator.py

Modified: CalendarServer/trunk/contrib/migration/calendarmigrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarmigrator.py	2012-03-15 22:14:59 UTC (rev 8877)
+++ CalendarServer/trunk/contrib/migration/calendarmigrator.py	2012-03-15 22:31:19 UTC (rev 8878)
@@ -278,6 +278,13 @@
             if key in ("requireComputerRecord",):
                 del combined["DirectoryService"]["params"][key]
 
+    # Disable XMPPNotifier now that we're directly talking to APNS
+    try:
+        if caldav["Notifications"]["Services"]["XMPPNotifier"]["Enabled"]:
+            caldav["Notifications"]["Services"]["XMPPNotifier"]["Enabled"] = False
+    except KeyError:
+        pass
+
     # Merge ports
     if not caldav.get("HTTPPort", 0):
         caldav["HTTPPort"] = 8008

Modified: CalendarServer/trunk/contrib/migration/calendarpromotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-03-15 22:14:59 UTC (rev 8877)
+++ CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-03-15 22:31:19 UTC (rev 8878)
@@ -36,13 +36,22 @@
         # Already exists
         pass
 
-    # Turn off services in case this is a re-promotion
     plistPath = os.path.join(DEST_CONFIG_DIR, CALDAVD_PLIST)
     if os.path.exists(plistPath):
         try:
             plistData = readPlist(plistPath)
+
+            # Turn off services in case this is a re-promotion
             plistData["EnableCalDAV"] = False
             plistData["EnableCardDAV"] = False
+
+            # Disable XMPPNotifier now that we're directly talking to APNS
+            try:
+                if plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"]:
+                    plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"] = False
+            except KeyError:
+                pass
+
             writePlist(plistData, plistPath)
         except Exception, e:
             print "Unable to disable services in %s: %s" % (plistPath, e)

Modified: CalendarServer/trunk/contrib/migration/test/test_migrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/test/test_migrator.py	2012-03-15 22:14:59 UTC (rev 8877)
+++ CalendarServer/trunk/contrib/migration/test/test_migrator.py	2012-03-15 22:31:19 UTC (rev 8878)
@@ -427,6 +427,45 @@
         self.assertEquals(newCombined, expected)
 
 
+    def test_disableXMPPNotifier(self):
+
+        # Ensure XMPPNotifier is disabled
+
+        oldCalDAV = {
+            "Notifications": {
+                "Services" : {
+                    "XMPPNotifier" : {
+                        "Enabled" : True,
+                    },
+                },
+            },
+        }
+        oldCardDAV = { }
+        expected = {
+            "Notifications": {
+                "Services" : {
+                    "XMPPNotifier" : {
+                        "Enabled" : False,
+                    },
+                },
+            },
+            "BindHTTPPorts": [8008, 8800],
+            "BindSSLPorts": [8443, 8843],
+            "EnableSSL" : False,
+            "HTTPPort": 8008,
+            "RedirectHTTPToHTTPS": False,
+            "SSLAuthorityChain": "",
+            "SSLCertificate": "",
+            "SSLPort": 8443,
+            "SSLPrivateKey": "",
+            "EnableCalDAV" : False,
+            "EnableCardDAV" : False,
+        }
+        newCombined = { }
+        mergePlist(oldCalDAV, oldCardDAV, newCombined)
+        self.assertEquals(newCombined, expected)
+
+
     def test_examinePreviousSystem(self):
         """
         Set up a virtual system in various configurations, then ensure the
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120315/c8106638/attachment.html>


More information about the calendarserver-changes mailing list