[CalendarServer-changes] [584] CalendarServer/branches/users/wsanchez/provisioning-2/bin/caldavd

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 27 14:40:05 PST 2006


Revision: 584
          http://trac.macosforge.org/projects/calendarserver/changeset/584
Author:   wsanchez at apple.com
Date:     2006-11-27 14:40:04 -0800 (Mon, 27 Nov 2006)

Log Message:
-----------
self.directoryservice, was being inserted as a string into the
generated TAC file, even though startServer() expects it to be a
dictionary.

When generating the TAC file, there's no need to create a bunch of
one-shot variables.

Also, it's safer to use %r than "%s" to emit a string into python
code.  This also works for dictionaries, which is how we can fix the
self.directoryservice bug.

Misc cleanup.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning-2/bin/caldavd

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/bin/caldavd
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/bin/caldavd	2006-11-27 22:19:47 UTC (rev 583)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/bin/caldavd	2006-11-27 22:40:04 UTC (rev 584)
@@ -65,13 +65,16 @@
         self.certfile = "/etc/certificates/Default.crt"
         self.manhole = 0
 
-        self.directoryservice = {"type":"OpenDirectoryService", "params":{"node":"/Search"},}
+        self.directoryservice = {
+            "type": "OpenDirectoryService",
+            "params": { "node": "/Search" },
+        }
 
         self.dropbox = True
         self.dropboxName = "dropbox"
         self.dropboxACLs = True
         self.notifications = False
-        self.notifcationName = "notifications"
+        self.notificationName = "notifications"
 
         self.serverlogfile = "/var/log/caldavd/server.log"
         self.errorlogfile = "/var/log/caldavd/error.log"
@@ -110,7 +113,7 @@
         print "Drop Box Name:                    %s" % (self.dropboxName,)
         print "Drop Box ACLs are Inherited       %s" % (self.dropboxACLs,)
         print "Notifications Enabled:            %s" % (self.notifications,)
-        print "Notification Collection Name:     %s" % (self.notifcationName,)
+        print "Notification Collection Name:     %s" % (self.notificationName,)
         print "Server Log File:                  %s" % (self.serverlogfile,)
         print "Error Log File:                   %s" % (self.errorlogfile,)
         print "PID File:                         %s" % (self.pidfile,)
@@ -295,7 +298,7 @@
                    "DropBoxName":                "dropboxName",
                    "DropBoxInheritedACLs":       "dropboxACLs",
                    "NotificationsEnabled":       "notifications",
-                   "NotificationCollectionName": "notifcationName",
+                   "NotificationCollectionName": "notificationName",
                    "ServerLogFile":              "serverlogfile",
                    "ErrorLogFile":               "errorlogfile",
                    "PIDFile":                    "pidfile",
@@ -359,71 +362,52 @@
     
     def generateTAC(self):
         return """
-docroot         = "%(docroot)s"
-repo             = "%(repo)s"
-doacct           =  %(doacct)s
-doacl            =  %(doacl)s
-dossl            =  %(dossl)s
-keyfile          = "%(keyfile)s"
-certfile         = "%(certfile)s"
-onlyssl          =  %(onlyssl)s
-port             =  %(port)d
-sslport          =  %(sslport)d
-maxsize          =  %(maxsize)d
-quota            =  %(quota)d
-serverlogfile    = "%(serverlogfile)s"
-directoryService = "%(directoryservice)s"
-dropbox          = "%(dropbox)s"
-dropboxName      = "%(dropboxName)s"
-dropboxACLs      = "%(dropboxACLs)s"
-notifications    = "%(notifications)s"
-notifcationName  = "%(notifcationName)s"
-manhole          =  %(manhole)d
-
 from twistedcaldav.repository import startServer
 
-application, site = startServer(docroot,
-                                repo,
-                                doacct,
-                                doacl,
-                                dossl,
-                                keyfile,
-                                certfile,
-                                onlyssl,
-                                port,
-                                sslport,
-                                maxsize,
-                                quota,
-                                serverlogfile,
-                                directoryservice,
-                                dropbox,
-                                dropboxName,
-                                dropboxACLs,
-                                notifications,
-                                notifcationName,
-                                manhole)
+application, site = startServer(
+    %(docroot)r,
+    %(repo)r,
+    %(doacct)s,
+    %(doacl)s,
+    %(dossl)s,
+    %(keyfile)r,
+    %(certfile)r,
+    %(onlyssl)s,
+    %(port)d,
+    %(sslport)d,
+    %(maxsize)d,
+    %(quota)d,
+    %(serverlogfile)r,
+    %(directoryservice)r,
+    %(dropbox)r,
+    %(dropboxName)r,
+    %(dropboxACLs)r,
+    %(notifications)r,
+    %(notificationName)r,
+    %(manhole)d,
+)
 
 """ % {
-    "docroot":         self.docroot,
-    "repo":            self.repo,
-    "doacct":          self.doacct,
-    "doacl":           self.doacl,
-    "dossl":           self.dossl,
-    "keyfile":         self.keyfile,
-    "certfile":        self.certfile,
-    "onlyssl":         self.onlyssl,
-    "port":            self.port,
-    "sslport":         self.sslport,
-    "maxsize":         self.maxsize,
-    "quota":           self.quota,
-    "serverlogfile":   self.serverlogfile,
-    "directoryservice":self.directoryservice,
-    "dropbox":         self.dropbox,
-    "dropboxName":     self.dropboxName,
-    "dropboxACLs":     self.dropboxACLs,
-    "notifications":   self.notifications,
-    "notifcationName": self.notifcationName,
-    "manhole":         self.manhole,
+    "docroot":          self.docroot,
+    "repo":             self.repo,
+    "doacct":           self.doacct,
+    "doacl":            self.doacl,
+    "dossl":            self.dossl,
+    "keyfile":          self.keyfile,
+    "certfile":         self.certfile,
+    "onlyssl":          self.onlyssl,
+    "port":             self.port,
+    "sslport":          self.sslport,
+    "maxsize":          self.maxsize,
+    "quota":            self.quota,
+    "serverlogfile":    self.serverlogfile,
+    "directoryservice": self.directoryservice,
+    "dropbox":          self.dropbox,
+    "dropboxName":      self.dropboxName,
+    "dropboxACLs":      self.dropboxACLs,
+    "notifications":    self.notifications,
+    "notificationName": self.notificationName,
+    "manhole":          self.manhole,
     
 }
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061127/9d736559/attachment.html


More information about the calendarserver-changes mailing list