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

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 22 16:15:02 PDT 2012


Revision: 9381
          http://trac.macosforge.org/projects/calendarserver/changeset/9381
Author:   sagen at apple.com
Date:     2012-06-22 16:15:02 -0700 (Fri, 22 Jun 2012)
Log Message:
-----------
Move XMPP-disabling logic back into promotionExtra

Modified Paths:
--------------
    CalendarServer/trunk/contrib/migration/calendardemotion.py
    CalendarServer/trunk/contrib/migration/calendarpromotion.py

Modified: CalendarServer/trunk/contrib/migration/calendardemotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendardemotion.py	2012-06-22 23:10:13 UTC (rev 9380)
+++ CalendarServer/trunk/contrib/migration/calendardemotion.py	2012-06-22 23:15:02 UTC (rev 9381)
@@ -23,20 +23,12 @@
 
     if os.path.exists(plistPath):
         try:
-            plistData = readPlist(plistPath)
-
             # Turn off services
+            plistData = readPlist(plistPath)
             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/calendarpromotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-06-22 23:10:13 UTC (rev 9380)
+++ CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-06-22 23:15:02 UTC (rev 9381)
@@ -14,6 +14,7 @@
 import shutil
 from pwd import getpwnam
 from grp import getgrnam
+from plistlib import readPlist, writePlist
 
 SRC_CONFIG_DIR = "/Applications/Server.app/Contents/ServerRoot/private/etc/caldavd"
 CALENDAR_SERVER_ROOT = "/Library/Server/Calendar and Contacts"
@@ -41,7 +42,22 @@
 
     plistPath = os.path.join(DEST_CONFIG_DIR, CALDAVD_PLIST)
 
-    if not os.path.exists(plistPath):
+    if os.path.exists(plistPath):
+        try:
+            plistData = readPlist(plistPath)
+
+            # Disable XMPPNotifier now that we're directly talking to APNS
+            try:
+                if plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"]:
+                    plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"] = False
+                writePlist(plistData, plistPath)
+            except KeyError:
+                pass
+
+        except Exception, e:
+            print "Unable to disable XMPP in %s: %s" % (plistPath, e)
+
+    else:
         # Copy configuration
         srcPlistPath = os.path.join(SRC_CONFIG_DIR, CALDAVD_PLIST)
         shutil.copy(srcPlistPath, DEST_CONFIG_DIR)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120622/858a4284/attachment-0001.html>


More information about the calendarserver-changes mailing list