[CalendarServer-changes] [9185] CalendarServer/trunk/contrib/migration/calendarpromotion.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 25 19:12:56 PDT 2012


Revision: 9185
          http://trac.macosforge.org/projects/calendarserver/changeset/9185
Author:   sagen at apple.com
Date:     2012-04-25 19:12:55 -0700 (Wed, 25 Apr 2012)
Log Message:
-----------
Calendar promotion extra needs to handle existence of an empty ServerRoot

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

Modified: CalendarServer/trunk/contrib/migration/calendarpromotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-04-25 17:36:41 UTC (rev 9184)
+++ CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-04-26 02:12:55 UTC (rev 9185)
@@ -29,14 +29,19 @@
     try:
         # Create calendar ServerRoot
         os.mkdir(CALENDAR_SERVER_ROOT)
+    except OSError:
+        # Already exists
+        pass
 
-        # Copy configuration
-        shutil.copytree(SRC_CONFIG_DIR, DEST_CONFIG_DIR)
+    try:
+        # Create calendar ConfigRoot
+        os.mkdir(DEST_CONFIG_DIR)
     except OSError:
         # Already exists
         pass
 
     plistPath = os.path.join(DEST_CONFIG_DIR, CALDAVD_PLIST)
+
     if os.path.exists(plistPath):
         try:
             plistData = readPlist(plistPath)
@@ -56,6 +61,11 @@
         except Exception, e:
             print "Unable to disable services in %s: %s" % (plistPath, e)
 
+    else:
+        # Copy configuration
+        srcPlistPath = os.path.join(SRC_CONFIG_DIR, CALDAVD_PLIST)
+        shutil.copy(srcPlistPath, DEST_CONFIG_DIR)
+
     # Create log directory
     try:
         os.mkdir(LOG_DIR, 0755)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120425/38d4591b/attachment.html>


More information about the calendarserver-changes mailing list