[CalendarServer-changes] [6677] CalendarServer/trunk/contrib/migration/calendarmigrator.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Dec 8 10:56:14 PST 2010


Revision: 6677
          http://trac.macosforge.org/projects/calendarserver/changeset/6677
Author:   sagen at apple.com
Date:     2010-12-08 10:56:09 -0800 (Wed, 08 Dec 2010)
Log Message:
-----------
During migration, create data root before copying files in case that directory doesn't exist.

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

Modified: CalendarServer/trunk/contrib/migration/calendarmigrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarmigrator.py	2010-12-08 17:37:22 UTC (rev 6676)
+++ CalendarServer/trunk/contrib/migration/calendarmigrator.py	2010-12-08 18:56:09 UTC (rev 6677)
@@ -442,7 +442,9 @@
     try:
         with open(LOG, 'a') as output:
             timestamp = datetime.datetime.now().strftime("%b %d %H:%M:%S")
-            output.write("%s %s\n" % (timestamp, msg))
+            msg = "calendarmigrator: %s %s" % (timestamp, msg)
+            output.write("%s\n" % (msg,)) # so it appears in our log
+            print msg # so it appears in Setup.log
     except IOError:
         # Could not write to log
         pass
@@ -611,6 +613,8 @@
 
         # Relocate calendar DataRoot, copying all files
         if os.path.exists(oldCalData):
+            if not os.path.exists(newCalData):
+                os.mkdir(newCalData)
             for item in list(os.listdir(oldCalData)):
                 source = os.path.join(oldCalData, item)
                 if not os.path.isfile(source):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101208/ed60a1dd/attachment.html>


More information about the calendarserver-changes mailing list