[CalendarServer-changes] [4173] CalendarServer/trunk/twistedcaldav/upgrade.py

source_changes at macosforge.org source_changes at macosforge.org
Mon May 4 19:58:05 PDT 2009


Revision: 4173
          http://trac.macosforge.org/projects/calendarserver/changeset/4173
Author:   sagen at apple.com
Date:     2009-05-04 19:58:05 -0700 (Mon, 04 May 2009)
Log Message:
-----------
Fix the ownership of the proxy db and resource info db (which now get created as root during migration)

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/upgrade.py

Modified: CalendarServer/trunk/twistedcaldav/upgrade.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/upgrade.py	2009-05-05 02:47:01 UTC (rev 4172)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py	2009-05-05 02:58:05 UTC (rev 4173)
@@ -244,7 +244,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)
@@ -262,8 +262,16 @@
                     [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)
 
+
+
     directory = getDirectory()
 
     docRoot = config.DocumentRoot
@@ -368,7 +376,7 @@
 
                 log.warn("Done processing calendar homes")
 
-    migrateResourceInfo(config, directory)
+    migrateResourceInfo(config, directory, uid, gid)
 
     if errorOccurred:
         raise UpgradeError("Data upgrade failed, see error.log for details")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090504/9ded2335/attachment.html>


More information about the calendarserver-changes mailing list