[CalendarServer-changes] [6755] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jan 19 11:52:27 PST 2011
Revision: 6755
http://trac.macosforge.org/projects/calendarserver/changeset/6755
Author: sagen at apple.com
Date: 2011-01-19 11:52:26 -0800 (Wed, 19 Jan 2011)
Log Message:
-----------
Strip trailing slash from ServerRoot in plist (otherwise DataRoot and DocumentRoot directories won't get auto-created)
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/stdconfig.py
CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py
Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py 2011-01-18 23:34:15 UTC (rev 6754)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py 2011-01-19 19:52:26 UTC (rev 6755)
@@ -714,6 +714,13 @@
Post-update configuration hook for making all configured paths relative to
their respective root directories rather than the current working directory.
"""
+
+ # Remove possible trailing slash from ServerRoot
+ try:
+ configDict["ServerRoot"] = configDict["ServerRoot"].rstrip("/")
+ except KeyError:
+ pass
+
for root, relativePath in RELATIVE_PATHS:
if root in configDict:
if isinstance(relativePath, str):
Modified: CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py 2011-01-18 23:34:15 UTC (rev 6754)
+++ CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py 2011-01-19 19:52:26 UTC (rev 6755)
@@ -142,3 +142,10 @@
cfg.load(tempfile1.path)
self.assertEquals(cfg.DocumentRoot, "/root/defaultdoc")
self.assertEquals(cfg.DataRoot, "/root/overridedata")
+
+ def test_updateDataStore(self):
+ configDict = {
+ "ServerRoot" : "/a/b/c/",
+ }
+ _updateDataStore(configDict)
+ self.assertEquals(configDict["ServerRoot"], "/a/b/c")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110119/e40b21bf/attachment-0001.html>
More information about the calendarserver-changes
mailing list