[CalendarServer-changes] [4634] CalendarServer/branches/users/cdaboo/partition-4464

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 22 12:19:33 PDT 2009


Revision: 4634
          http://trac.macosforge.org/projects/calendarserver/changeset/4634
Author:   cdaboo at apple.com
Date:     2009-10-22 12:19:32 -0700 (Thu, 22 Oct 2009)
Log Message:
-----------
Catch up with changes on the deployment branch.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/provision/root.py
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/sidecar/task.py
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tap/caldav.py
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/principals.py
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/util.py
    CalendarServer/branches/users/cdaboo/partition-4464/conf/caldavd-test.plist
    CalendarServer/branches/users/cdaboo/partition-4464/memcacheclient.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/augment.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/cachingdirectory.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/calendaruserproxy.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/index.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/mail.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcachepool.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcacher.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/notify.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/stdconfig.py
    CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/test/util.py

Added Paths:
-----------
    CalendarServer/branches/users/cdaboo/partition-4464/bin/calendarserver_load_augmentdb
    CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/loadaugmentdb.py

Added: CalendarServer/branches/users/cdaboo/partition-4464/bin/calendarserver_load_augmentdb
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/bin/calendarserver_load_augmentdb	                        (rev 0)
+++ CalendarServer/branches/users/cdaboo/partition-4464/bin/calendarserver_load_augmentdb	2009-10-22 19:19:32 UTC (rev 4634)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+##
+# Copyright (c) 2006-2007 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+import sys
+
+#PYTHONPATH
+
+if __name__ == "__main__":
+    if "PYTHONPATH" in globals():
+        sys.path.insert(0, PYTHONPATH)
+    else:
+        from os.path import dirname, abspath, join
+        from subprocess import Popen, PIPE
+
+        home = dirname(dirname(abspath(__file__)))
+        run = join(home, "run")
+
+        child = Popen((run, "-p"), stdout=PIPE)
+        path, stderr = child.communicate()
+
+        if child.wait() == 0:
+            sys.path[0:0] = path.split(":")
+
+    from calendarserver.tools.loadaugmentdb import main
+    main()


Property changes on: CalendarServer/branches/users/cdaboo/partition-4464/bin/calendarserver_load_augmentdb
___________________________________________________________________
Added: svn:executable
   + *

Modified: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/provision/root.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/provision/root.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/provision/root.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -62,7 +62,7 @@
 
         self.contentFilters = []
 
-        if config.Memcached["ClientEnabled"]:
+        if config.Memcached.Pools.Default.ClientEnabled:
             self.responseCache = MemcacheResponseCache(self.fp)
 
             CalendarHomeFile.cacheNotifierFactory = MemcacheChangeNotifier

Modified: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/sidecar/task.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/sidecar/task.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/sidecar/task.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -379,11 +379,10 @@
         #
         # Configure Memcached Client Pool
         #
-        if config.Memcached.ClientEnabled:
-            memcachepool.installPools(
-                config.Memcached.Pools,
-                config.Memcached.MaxClients,
-            )
+        memcachepool.installPools(
+            config.Memcached.Pools,
+            config.Memcached.MaxClients,
+        )
 
         #
         # Configure NotificationClient

Modified: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tap/caldav.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tap/caldav.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -388,10 +388,10 @@
                 # Now do any on disk upgrades we might need.
                 # Memcache isn't running at this point, so temporarily change
                 # the config so nobody tries to talk to it while upgrading
-                memcacheSetting = config.Memcached.ClientEnabled
-                config.Memcached.ClientEnabled = False
+                memcacheSetting = config.Memcached.Pools.Default.ClientEnabled
+                config.Memcached.Pools.Default.ClientEnabled = False
                 upgradeData(config)
-                config.Memcached.ClientEnabled = memcacheSetting
+                config.Memcached.Pools.Default.ClientEnabled = memcacheSetting
 
 
             service = serviceMethod(options)
@@ -534,11 +534,10 @@
         #
         # Configure Memcached Client Pool
         #
-        if config.Memcached.ClientEnabled:
-            memcachepool.installPools(
-                config.Memcached.Pools,
-                config.Memcached.MaxClients,
-            )
+        memcachepool.installPools(
+            config.Memcached.Pools,
+            config.Memcached.MaxClients,
+        )
 
         #
         # Configure NotificationClient
@@ -1099,26 +1098,24 @@
                 env=parentEnv,
             )
 
-        if config.Memcached.ServerEnabled:
-            self.log_info("Adding memcached service")
+        for name, pool in config.Memcached.Pools.items():
+            if pool.ServerEnabled:
+                self.log_info("Adding memcached service for pool: %s" % (name,))
+        
+                memcachedArgv = [
+                    config.Memcached.memcached,
+                    "-p", str(pool.Port),
+                    "-l", pool.BindAddress,
+                    "-U", "0",
+                ]
+        
+                if config.Memcached.MaxMemory is not 0:
+                    memcachedArgv.extend(["-m", str(config.Memcached.MaxMemory)])
+        
+                memcachedArgv.extend(config.Memcached.Options)
+        
+                monitor.addProcess('memcached-%s' % (name,), memcachedArgv, env=parentEnv)
 
-            memcachedArgv = [
-                config.Memcached.memcached,
-                "-p", str(config.Memcached.Port),
-                "-l", config.Memcached.BindAddress,
-                "-U", "0",
-            ]
-
-            if config.Memcached.MaxMemory is not 0:
-                memcachedArgv.extend(["-m", str(config.Memcached.MaxMemory)])
-
-            if config.UserName:
-                memcachedArgv.extend(["-u", config.UserName])
-
-            memcachedArgv.extend(config.Memcached.Options)
-
-            monitor.addProcess("memcached", memcachedArgv, env=parentEnv)
-
         if (
             config.Notifications.Enabled and
             config.Notifications.InternalNotificationHost == "localhost"
@@ -1292,9 +1289,6 @@
                   % (config.ControlPort,),
         ])
 
-        if config.Memcached.ServerEnabled:
-            args.extend(["-o", "Memcached/ClientEnabled=True"])
-
         if self.ports:
             args.extend([
                 "-o", "BindHTTPPorts=%s" % (",".join(map(str, self.ports)),)

Added: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/loadaugmentdb.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/loadaugmentdb.py	                        (rev 0)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/loadaugmentdb.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -0,0 +1,187 @@
+#!/usr/bin/env python
+from twistedcaldav.directory import augment
+from twistedcaldav.directory.augment import AugmentXMLDB
+
+##
+# Copyright (c) 2006-2007 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+
+from calendarserver.tools.util import loadConfig, getDirectory,\
+    autoDisableMemcached
+from getopt import getopt, GetoptError
+from grp import getgrnam
+from pwd import getpwnam
+from sys import stdout, stderr
+from twisted.internet import reactor
+from twisted.internet.defer import inlineCallbacks
+from twisted.python.log import addObserver, removeObserver
+from twisted.python.util import switchUID
+from twistedcaldav.config import config, ConfigurationError
+from twistedcaldav.log import setLogLevelForNamespace
+import os
+import sys
+
+class UsageError (StandardError):
+    pass
+
+class StandardIOObserver (object):
+    """
+    Log observer that writes to standard I/O.
+    """
+    def emit(self, eventDict):
+        text = None
+
+        if eventDict["isError"]:
+            output = stderr
+            if "failure" in eventDict:
+                text = eventDict["failure"].getTraceback()
+        else:
+            output = stdout
+
+        if not text:
+            text = " ".join([str(m) for m in eventDict["message"]]) + "\n"
+
+        output.write(text)
+        output.flush()
+
+    def start(self):
+        addObserver(self.emit)
+
+    def stop(self):
+        removeObserver(self.emit)
+
+def usage(e=None):
+    if e:
+        print e
+        print ""
+
+    name = os.path.basename(sys.argv[0])
+    print "usage: %s [options]" % (name,)
+    print ""
+    print "Populate an sqlite or PostgreSQL augments database with values"
+    print "from an XML augments file."
+    print ""
+    print "options:"
+    print "  -h --help: print this help and exit"
+    print "  -f --config: Specify caldavd.plist configuration path"
+    print "  -x --xmlfile: Specify xml augments file path"
+    print "  -r --remove: Remove all entries from the database"
+
+    if e:
+        sys.exit(64)
+    else:
+        sys.exit(0)
+
+def main():
+    try:
+        (optargs, args) = getopt(
+            sys.argv[1:], "hf:rx:", [
+                "config=",
+                "remove",
+                "xmlfile=",
+                "help",
+            ],
+        )
+    except GetoptError, e:
+        usage(e)
+
+    configFileName = None
+    xmlFileName = None
+    remove = False
+
+    for opt, arg in optargs:
+        if opt in ("-h", "--help"):
+            usage()
+
+        elif opt in ("-f", "--config"):
+            configFileName = arg
+
+        elif opt in ("-r", "--remove"):
+            remove = True
+            if raw_input("Do you really want to remove all records from the database? [y/n] ") != "y":
+                sys.exit(0)
+
+        elif opt in ("-x", "--xmlfile"):
+            xmlFileName = arg
+
+    if args:
+        usage("Too many arguments: %s" % (" ".join(args),))
+
+    observer = StandardIOObserver()
+    observer.start()
+
+    #
+    # Get configuration
+    #
+    try:
+        loadConfig(configFileName)
+        setLogLevelForNamespace(None, "warn")
+
+        # Shed privileges
+        if config.UserName and config.GroupName and os.getuid() == 0:
+            uid = getpwnam(config.UserName).pw_uid
+            gid = getgrnam(config.GroupName).gr_gid
+            switchUID(uid, uid, gid)
+
+        os.umask(config.umask)
+
+        config.directory = getDirectory()
+        autoDisableMemcached(config)
+    except ConfigurationError, e:
+        usage("Unable to start: %s" % (e,))
+
+    try:
+        dbxml = AugmentXMLDB((xmlFileName,)) if not remove else None
+    except IOError, e:
+        usage("Could not read XML augment file: %s" % (e,))
+
+    #
+    # Start the reactor
+    #
+    reactor.callLater(0, run, dbxml)
+    reactor.run()
+
+ at inlineCallbacks
+def run(dbxml):
+    
+    try:
+        guids = set((yield augment.AugmentService.getAllGUIDs()))
+        added = 0
+        updated = 0
+        removed = 0
+        if dbxml:
+            for record in dbxml.db.values():
+                yield augment.AugmentService.addAugmentRecord(record, record.guid in guids)
+                if record.guid in guids:
+                    updated += 1
+                else:
+                    added += 1
+            for guid in guids.difference(dbxml.db.keys()):
+                yield augment.AugmentService.removeAugmentRecord(guid)
+                removed += 1
+        else:
+            yield augment.AugmentService.clean()
+            removed = len(guids)
+            
+        print "Changes:"
+        print "  Added: %d" % (added,)
+        print "  Changed: %d" % (updated,)
+        print "  Removed: %d" % (removed,)
+    finally:
+        #
+        # Stop the reactor
+        #
+        reactor.stop()


Property changes on: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/loadaugmentdb.py
___________________________________________________________________
Added: svn:executable
   + *

Modified: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/principals.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/principals.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/principals.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -217,11 +217,10 @@
         #
         # Connect to memcached, notifications
         #
-        if config.Memcached.ClientEnabled:
-            memcachepool.installPools(
-                config.Memcached.Pools,
-                config.Memcached.MaxClients
-            )
+        memcachepool.installPools(
+            config.Memcached.Pools,
+            config.Memcached.MaxClients
+        )
         if config.Notifications.Enabled:
             installNotificationClient(
                 config.Notifications.InternalNotificationHost,

Modified: CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/util.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/util.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/calendarserver/tools/util.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -136,7 +136,7 @@
     If memcached is not running, set config.Memcached.ClientEnabled to False
     """
 
-    if not config.Memcached.ClientEnabled:
+    if not config.Memcached.Pools.Default.ClientEnabled:
         return
 
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -146,4 +146,4 @@
         s.close()
 
     except socket.error:
-        config.Memcached.ClientEnabled = False
+        config.Memcached.Pools.Default.ClientEnabled = False

Modified: CalendarServer/branches/users/cdaboo/partition-4464/conf/caldavd-test.plist
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/conf/caldavd-test.plist	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/conf/caldavd-test.plist	2009-10-22 19:19:32 UTC (rev 4634)
@@ -693,10 +693,6 @@
     <!-- Support for Memcached -->
     <key>Memcached</key>
     <dict>
-      <key>ServerEnabled</key>
-      <true/>
-      <key>ClientEnabled</key>
-      <true/>
       <key>MaxClients</key>
       <integer>5</integer>
       <key>memcached</key>

Modified: CalendarServer/branches/users/cdaboo/partition-4464/memcacheclient.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/memcacheclient.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/memcacheclient.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -124,7 +124,7 @@
                  pickler=pickle.Pickler, unpickler=pickle.Unpickler,
                  pload=None, pid=None):
 
-        if config.Memcached.ClientEnabled:
+        if config.Memcached.Pools.Default.ClientEnabled:
             return Client(servers, debug=debug, pickleProtocol=pickleProtocol,
                 pickler=pickler, unpickler=unpickler, pload=pload, pid=pid)
         elif cls.allowTestCache:

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/augment.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/augment.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/augment.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -305,8 +305,8 @@
     PostgreSQL based augment database implementation.
     """
 
-    def __init__(self, host, database):
+    def __init__(self, host, database, user=None, password=None):
         
         ADBAPIPostgreSQLMixin.__init__(self)
-        AugmentADAPI.__init__(self, "Augments", "pgdb", (), host=host, database=database,)
+        AugmentADAPI.__init__(self, "Augments", "pgdb", (), host=host, database=database, user=user, password=password,)
 

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/cachingdirectory.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/cachingdirectory.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/cachingdirectory.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -75,7 +75,7 @@
     def addRecord(self, record, indexType, indexKey, useMemcache=True,
         neverExpire=False):
 
-        useMemcache = useMemcache and config.Memcached.ClientEnabled
+        useMemcache = useMemcache and config.Memcached.Pools.Default.ClientEnabled
         if neverExpire:
             record.neverExpire()
 
@@ -288,7 +288,7 @@
                 pass
             
             # Check memcache
-            if config.Memcached.ClientEnabled:
+            if config.Memcached.Pools.Default.ClientEnabled:
                 key = "dir|%s|%s" % (indexType, indexKey)
                 record = self.memcacheGet(key)
                 self.log_debug("Memcache: checking %s" % (key,))
@@ -321,7 +321,7 @@
             self.log_debug("Failed to fault record for attribute '%s' with value '%s'" % (indexType, indexKey,))
             self._disabledKeys[indexType][indexKey] = time.time()
 
-            if config.Memcached.ClientEnabled:
+            if config.Memcached.Pools.Default.ClientEnabled:
                 self.log_debug("Memcache: storing (negative) %s" % (key,))
                 self.memcacheSet("-%s" % (key,), 1)
 

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/calendaruserproxy.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/calendaruserproxy.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/directory/calendaruserproxy.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -773,10 +773,10 @@
     PostgreSQL based augment database implementation.
     """
 
-    def __init__(self, host, database):
+    def __init__(self, host, database, user=None, password=None):
         
         ADBAPIPostgreSQLMixin.__init__(self, )
-        ProxyDB.__init__(self, "Proxies", "pgdb", (), host=host, database=database,)
+        ProxyDB.__init__(self, "Proxies", "pgdb", (), host=host, database=database, user=user, password=password,)
 
 
 ##

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/index.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/index.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/index.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -741,7 +741,7 @@
         assert resource.isCalendarCollection(), "non-calendar collection resource %s has no index." % (resource,)
         super(Index, self).__init__(resource)
 
-        if config.Memcached['ClientEnabled']:
+        if config.Memcached.Pools.Default.ClientEnabled:
             self.reserver = MemcachedUIDReserver(self)
 
         else:

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/mail.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/mail.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/mail.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -544,11 +544,10 @@
 
     def makeService(self, options):
 
-        if config.Memcached.ClientEnabled:
-            memcachepool.installPools(
-                config.Memcached.Pools,
-                config.Memcached.MaxClients,
-            )
+        memcachepool.installPools(
+            config.Memcached.Pools,
+            config.Memcached.MaxClients,
+        )
 
         multiService = service.MultiService()
 

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcachepool.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcachepool.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcachepool.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -387,7 +387,7 @@
 def installPools(pools, maxClients=5, reactor=None):
     
     for name, pool in pools.items():
-        if pool["Enabled"]:
+        if pool["ServerEnabled"]:
             _installPool(
                 name,
                 pool["HandleCacheTypes"],

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcacher.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcacher.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/memcacher.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -115,7 +115,7 @@
         if self._memcacheProtocol is not None:
             return self._memcacheProtocol
 
-        if config.Memcached['ClientEnabled']:
+        if config.Memcached.Pools.Default.ClientEnabled:
             self._memcacheProtocol = self.getCachePool()
 
         elif config.ProcessType == "Single" or self._noInvalidation:

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/notify.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/notify.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/notify.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -1296,11 +1296,10 @@
         #
         # Configure Memcached Client Pool
         #
-        if config.Memcached.ClientEnabled:
-            memcachepool.installPools(
-                config.Memcached.Pools,
-                config.Memcached.MaxClients,
-            )
+        memcachepool.installPools(
+            config.Memcached.Pools,
+            config.Memcached.MaxClients,
+        )
 
         multiService = service.MultiService()
 

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/stdconfig.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/stdconfig.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -53,8 +53,10 @@
         "dbpath": "/etc/caldavd/augments.sqlite",
     },
     "twistedcaldav.directory.augment.AugmentPostgreSQLDB": {
-        "host": "localhost",
+        "host":     "localhost",
         "database": "augments",
+        "user":     "",
+        "password": "",
     },
 }
 
@@ -63,8 +65,10 @@
         "dbpath": "/etc/caldavd/proxies.sqlite",
     },
     "twistedcaldav.directory.calendaruserproxy.ProxyPostgreSQLDB": {
-        "host": "localhost",
+        "host":     "localhost",
         "database": "proxies",
+        "user":     "",
+        "password": "",
     },
 }
 
@@ -430,25 +434,25 @@
 
     "Memcached": {
         "MaxClients": 5,
-        "ClientEnabled": True,
-        "ServerEnabled": True,
         "Pools": {
             "Default": {
-                "Enabled": True,
+                "ClientEnabled": True,
+                "ServerEnabled": True,
                 "BindAddress": "127.0.0.1",
                 "Port": 11211,
                 "HandleCacheTypes": [
                     "Default",
                 ]
             },
-            "ProxyDB": {
-                "Enabled": True,
-                "BindAddress": "127.0.0.1",
-                "Port": 11211,
-                "HandleCacheTypes": [
-                    "ProxyDB", "PrincipalToken",
-                ]
-            },
+#            "ProxyDB": {
+#                "ClientEnabled": True,
+#                "ServerEnabled": True,
+#                "BindAddress": "127.0.0.1",
+#                "Port": 11211,
+#                "HandleCacheTypes": [
+#                    "ProxyDB", "PrincipalToken",
+#                ]
+#            },
         },
         "memcached": "memcached", # Find in PATH
         "MaxMemory": 0, # Megabytes

Modified: CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/test/util.py
===================================================================
--- CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/test/util.py	2009-10-22 19:16:48 UTC (rev 4633)
+++ CalendarServer/branches/users/cdaboo/partition-4464/twistedcaldav/test/util.py	2009-10-22 19:19:32 UTC (rev 4634)
@@ -41,8 +41,8 @@
         dataroot = self.mktemp()
         os.mkdir(dataroot)
         config.DataRoot = dataroot
-        config.Memcached.ClientEnabled = False
-        config.Memcached.ServerEnabled = False
+        config.Memcached.Pools.Default.ClientEnabled = False
+        config.Memcached.Pools.Default.ServerEnabled = False
         memcacheclient.ClientFactory.allowTestCache = True
 
     def createHierarchy(self, structure):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091022/7e825cf2/attachment-0001.html>


More information about the calendarserver-changes mailing list