[CalendarServer-changes] [4189] CalendarServer/branches/release/CalendarServer-2.2-dev/twistedcaldav /upgrade.py

source_changes at macosforge.org source_changes at macosforge.org
Tue May 5 17:06:12 PDT 2009


Revision: 4189
          http://trac.macosforge.org/projects/calendarserver/changeset/4189
Author:   sagen at apple.com
Date:     2009-05-05 17:06:11 -0700 (Tue, 05 May 2009)
Log Message:
-----------
Set the correct ownership on ResourceInfo DB and Proxy DB

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-2.2-dev/twistedcaldav/upgrade.py

Modified: CalendarServer/branches/release/CalendarServer-2.2-dev/twistedcaldav/upgrade.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-2.2-dev/twistedcaldav/upgrade.py	2009-05-06 00:01:52 UTC (rev 4188)
+++ CalendarServer/branches/release/CalendarServer-2.2-dev/twistedcaldav/upgrade.py	2009-05-06 00:06:11 UTC (rev 4189)
@@ -245,7 +245,7 @@
         os.rename(oldHome, newHome)
 
 
-    def migrateResourceInfo(config, directory):
+    def migrateResourceInfo(config, directory, uid, gid):
         log.info("Fetching delegate assignments and auto-schedule settings from directory")
         resourceInfoDatabase = ResourceInfoDatabase(config.DataRoot)
         calendarUserProxyDatabase = CalendarUserProxyDatabase(config.DataRoot)
@@ -263,7 +263,13 @@
                     [readOnlyProxy]
                 )
 
+        dbPath = os.path.join(config.DataRoot, ResourceInfoDatabase.dbFilename)
+        if os.path.exists(dbPath):
+            os.chown(dbPath, uid, gid)
 
+        dbPath = os.path.join(config.DataRoot, CalendarUserProxyDatabase.dbFilename)
+        if os.path.exists(dbPath):
+            os.chown(dbPath, uid, gid)
 
     def createMailTokensDatabase(config, uid, gid):
         # Cause the tokens db to be created on disk so we can set the
@@ -379,7 +385,7 @@
 
                 log.warn("Done processing calendar homes")
 
-    migrateResourceInfo(config, directory)
+    migrateResourceInfo(config, directory, uid, gid)
     createMailTokensDatabase(config, uid, gid)
 
     if errorOccurred:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090505/5839ebe1/attachment.html>


More information about the calendarserver-changes mailing list