[CalendarServer-changes] [7082] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Feb 25 10:05:27 PST 2011


Revision: 7082
          http://trac.macosforge.org/projects/calendarserver/changeset/7082
Author:   sagen at apple.com
Date:     2011-02-25 10:05:25 -0800 (Fri, 25 Feb 2011)
Log Message:
-----------
Defend against the situation where launchd starts calendar server outside the context of serveradmin (EnableCalDAV and EnableCardDAV will both be False in that situation).

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/caldav.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py

Modified: CalendarServer/trunk/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/caldav.py	2011-02-25 15:30:50 UTC (rev 7081)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py	2011-02-25 18:05:25 UTC (rev 7082)
@@ -282,6 +282,13 @@
         checkDirectory(dirpath, description, access=access, create=create)
 
     def checkConfiguration(self):
+
+        # Having CalDAV *and* CardDAV both disabled is an illegal configuration
+        # for a running server (but is fine for command-line utilities)
+        if not config.EnableCalDAV and not config.EnableCardDAV:
+            print "Neither EnableCalDAV nor EnableCardDAV are set to True."
+            sys.exit(1)
+
         uid, gid = None, None
 
         if self.parent["uid"] or self.parent["gid"]:

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2011-02-25 15:30:50 UTC (rev 7081)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2011-02-25 18:05:25 UTC (rev 7082)
@@ -1123,9 +1123,6 @@
 
 def _updateCompliance(configDict):
 
-    if not (configDict.EnableCalDAV or configDict.EnableCardDAV):
-        log.warn("Neither 'EnableCalDAV' nor 'EnableCardDAV' are set to True")
-
     if configDict.EnableCalDAV:
         if configDict.Scheduling.CalDAV.OldDraftCompatibility:
             compliance = caldavxml.caldav_full_compliance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110225/81ed5254/attachment.html>


More information about the calendarserver-changes mailing list