[CalendarServer-changes] [3479] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Dec 9 08:50:43 PST 2008


Revision: 3479
          http://trac.macosforge.org/projects/calendarserver/changeset/3479
Author:   cdaboo at apple.com
Date:     2008-12-09 08:50:42 -0800 (Tue, 09 Dec 2008)
Log Message:
-----------
Include server instance in accounting logs.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
    CalendarServer/trunk/twistedcaldav/accesslog.py
    CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2008-12-09 16:04:07 UTC (rev 3478)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2008-12-09 16:50:42 UTC (rev 3479)
@@ -20,7 +20,7 @@
          if kw.has_key('site'):
              self.site = kw['site']
              del kw['site']
-@@ -150,17 +154,32 @@
+@@ -150,17 +154,33 @@
              self._initialprepath = kw['prepathuri']
              del kw['prepathuri']
  
@@ -32,6 +32,7 @@
          self.files = {}
          self.resources = []
          http.Request.__init__(self, *args, **kw)
++        self.serverInstance = self.chanRequest.transport.server.port
  
 -    def addResponseFilter(self, f, atEnd=False):
 +    def addResponseFilter(self, filter, atEnd=False, onlyOnce=False):
@@ -56,7 +57,7 @@
  
      def unparseURL(self, scheme=None, host=None, port=None,
                     path=None, params=None, querystring=None, fragment=None):
-@@ -265,6 +284,7 @@
+@@ -265,6 +285,7 @@
          
          d = defer.Deferred()
          d.addCallback(self._getChild, self.site.resource, self.postpath)
@@ -64,7 +65,7 @@
          d.addCallback(lambda res, req: res.renderHTTP(req), self)
          d.addCallback(self._cbFinishRender)
          d.addErrback(self._processingFailed)
-@@ -321,7 +341,6 @@
+@@ -321,7 +342,6 @@
          if newpath is StopTraversal:
              # We need to rethink how to do this.
              #if newres is res:
@@ -72,7 +73,7 @@
                  return res
              #else:
              #    raise ValueError("locateChild must not return StopTraversal with a resource other than self.")
-@@ -337,7 +356,6 @@
+@@ -337,7 +357,6 @@
                  self.prepath.append(self.postpath.pop(0))
  
          child = self._getChild(None, newres, newpath, updatepaths=updatepaths)
@@ -80,7 +81,7 @@
  
          return child
  
-@@ -347,6 +365,7 @@
+@@ -347,6 +366,7 @@
          """
          Remember the URL of a visited resource.
          """
@@ -88,7 +89,7 @@
          self._urlsByResource[resource] = url
          return resource
  
-@@ -386,7 +405,8 @@
+@@ -386,7 +406,8 @@
              The contained response will have a status code of
              L{responsecode.BAD_REQUEST}.
          """
@@ -98,7 +99,7 @@
  
          #
          # Parse the URL
-@@ -407,9 +427,13 @@
+@@ -407,9 +428,13 @@
                  "URL is not on this site (%s://%s/): %s" % (scheme, self.headers.getHeader("host"), url)
              ))
  
@@ -114,7 +115,7 @@
  
          def notFound(f):
              f.trap(http.HTTPError)
-@@ -417,7 +441,7 @@
+@@ -417,7 +442,7 @@
                  return f
              return None
  

Modified: CalendarServer/trunk/twistedcaldav/accesslog.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/accesslog.py	2008-12-09 16:04:07 UTC (rev 3478)
+++ CalendarServer/trunk/twistedcaldav/accesslog.py	2008-12-09 16:50:42 UTC (rev 3479)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2006-2007 Apple Inc. All rights reserved.
+# Copyright (c) 2006-2008 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.
@@ -115,7 +115,7 @@
             if config.MoreAccessLogData:
                 format_str += ' [%d %d]'
                 format_data += (
-                    request.chanRequest.transport.server.port,
+                    request.serverInstance,
                     request.chanRequest.channel.factory.outstandingRequests,
                 )
             self.logMessage(format_str % format_data)

Modified: CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py	2008-12-09 16:04:07 UTC (rev 3478)
+++ CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py	2008-12-09 16:50:42 UTC (rev 3479)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+# Copyright (c) 2005-2008 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.
@@ -316,10 +316,11 @@
             if accountingEnabled("iTIP", self.organizer.principal):
                 emitAccounting(
                     "iTIP", self.organizer.principal,
-                    "Originator: %s\nRecipients:\n%s\n%s"
+                    "Originator: %s\nRecipients:\n%sServer Instance:%s\n\n%s"
                     % (
                         str(self.originator),
                         "".join(["    %s\n" % (recipient,) for recipient in self.recipients]),
+                        self.request.serverInstance,
                         str(self.calendar)
                     )
                 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081209/4c42ff99/attachment-0001.html>


More information about the calendarserver-changes mailing list