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

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 13 15:59:34 PDT 2012


Revision: 8857
          http://trac.macosforge.org/projects/calendarserver/changeset/8857
Author:   sagen at apple.com
Date:     2012-03-13 15:59:34 -0700 (Tue, 13 Mar 2012)
Log Message:
-----------
Relocate Documents under Data in default config

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	2012-03-13 22:46:52 UTC (rev 8856)
+++ CalendarServer/trunk/contrib/migration/calendarmigrator.py	2012-03-13 22:59:34 UTC (rev 8857)
@@ -524,6 +524,16 @@
                     absolutePathWithRoot(sourceRoot, oldServerRootValue),
                     newServerRoot
                 )
+                newDataRoot = os.path.join(newServerRoot, "Data")
+                if not diskAccessor.exists(newDataRoot):
+                    diskAccessor.mkdir(newDataRoot)
+                newDocumentRoot = os.path.join(newDataRoot, "Documents")
+                if diskAccessor.exists(os.path.join(newServerRoot, "Documents")):
+                    log("Moving Documents into Data root: %s" % (newDataRoot,))
+                    diskAccessor.rename(os.path.join(newServerRoot, "Documents"),
+                        newDocumentRoot)
+                else:
+                    diskAccessor.mkdir(newDocumentRoot)
             else:
                 log("Creating new calendar server root: %s" % (newServerRoot,))
                 diskAccessor.mkdir(newServerRoot)

Modified: CalendarServer/trunk/contrib/migration/test/test_migrator.py
===================================================================
--- CalendarServer/trunk/contrib/migration/test/test_migrator.py	2012-03-13 22:46:52 UTC (rev 8856)
+++ CalendarServer/trunk/contrib/migration/test/test_migrator.py	2012-03-13 22:59:34 UTC (rev 8857)
@@ -1209,6 +1209,8 @@
                 "/Library/Server/Previous/Library/Server/Calendar and Contacts/Documents/" : True,
                 "/Library/Server/Previous/Library/Server/Calendar and Contacts/Data/" : True,
                 "/Volumes/new/Library/Server/Calendar and Contacts/" : True,
+                "/Volumes/new/Library/Server/Calendar and Contacts/Data" : True,
+                "/Volumes/new/Library/Server/Calendar and Contacts/Documents" : True,
             },
             (   # args
                 "/Library/Server/Previous", # sourceRoot
@@ -1227,6 +1229,7 @@
             ),
             [
                 ('ditto', '/Library/Server/Previous/Library/Server/Calendar and Contacts', '/Volumes/new/Library/Server/Calendar and Contacts'),
+                ('rename', '/Volumes/new/Library/Server/Calendar and Contacts/Documents', '/Volumes/new/Library/Server/Calendar and Contacts/Data/Documents'),
                 ('chown-recursive', '/Volumes/new/Library/Server/Calendar and Contacts', FakeUser.pw_uid, FakeGroup.gr_gid),
             ]
         ),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120313/d734d6b0/attachment.html>


More information about the calendarserver-changes mailing list