[CalendarServer-changes] [3708] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 23 13:35:47 PST 2009


Revision: 3708
          http://trac.macosforge.org/projects/calendarserver/changeset/3708
Author:   darla at apple.com
Date:     2009-02-23 13:35:47 -0800 (Mon, 23 Feb 2009)
Log Message:
-----------
Moved stray socket fix from config to caldav.py.

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

Modified: CalendarServer/trunk/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/caldav.py	2009-02-21 20:58:59 UTC (rev 3707)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py	2009-02-23 21:35:47 UTC (rev 3708)
@@ -21,6 +21,7 @@
 ]
 
 import os
+import stat
 import sys
 
 from tempfile import mkstemp
@@ -617,6 +618,13 @@
         #
         self.log_info("Setting up service")
 
+        # Make sure no old socket files are lying around.
+        if (os.path.exists(config.ControlSocket)):
+            # See if the file represents an active socket.  If not, delete it.
+            if (not stat.S_ISSOCK(os.stat(config.ControlSocket).st_mode)):
+                self.log_warn("Deleting stale socket file: %s" % config.ControlSocket)
+                os.remove(config.ControlSocket)
+        
         if config.ProcessType == "Slave":
             if (
                 config.MultiProcess.ProcessCount > 1 and
@@ -741,6 +749,13 @@
         # Process localization string files
         processLocalizationFiles(config.Localization)
 
+        # Make sure no old socket files are lying around.
+        if (os.path.exists(config.ControlSocket)):
+            # See if the file represents an active socket.  If not, delete it.
+            if (not stat.S_ISSOCK(os.stat(config.ControlSocket).st_mode)):
+                self.log_warn("Deleting stale socket file: %s" % config.ControlSocket)
+                os.remove(config.ControlSocket)
+        
         # The logger service must come before the monitor service, otherwise
         # we won't know which logging port to pass to the slaves' command lines
 

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2009-02-21 20:58:59 UTC (rev 3707)
+++ CalendarServer/trunk/twistedcaldav/config.py	2009-02-23 21:35:47 UTC (rev 3708)
@@ -26,7 +26,6 @@
 import os
 import copy
 import re
-import stat
 
 from twisted.web2.dav import davxml
 from twisted.web2.dav.resource import TwistedACLInheritable
@@ -431,7 +430,6 @@
             self.updateRejectClients,
             self.updateDropBox,
             self.updateLogLevels,
-            self.updateControlSocket,
             self.updateNotifications,
             self.updateScheduling,
         ]
@@ -601,17 +599,6 @@
         except InvalidLogLevelError, e:
             raise ConfigurationError("Invalid log level: %s" % (e.level))
 
-    @staticmethod
-    def updateControlSocket(self, items):
-        
-        # Make sure no old socket files are lying around.
-        if (os.path.exists(self.ControlSocket)):
-            # See if the file represents an active socket.
-            # If not, delete it.
-            if (not stat.S_ISSOCK(os.stat(self.ControlSocket).st_mode)):
-                log.warn("Deleting stale socket file: %s" % self.ControlSocket)
-                os.remove(self.ControlSocket)
-
     def updateDefaults(self, items):
         _mergeData(self._defaults, items)
         self.update(items)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090223/26c3f140/attachment.html>


More information about the calendarserver-changes mailing list