wingo - in flumotion/branches/platform-3: . flumotion/worker/checks

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Mon Jun 11 17:13:07 CEST 2007


Author: wingo
Date: Mon Jun 11 17:13:04 2007
New Revision: 5150

Modified:
   flumotion/branches/platform-3/ChangeLog
   flumotion/branches/platform-3/flumotion/worker/checks/fixes.py
Log:
	(fixLogRotation): Add more terror to make sure that an admin
	doesn't call this function twice, or on a worker that does not
	need it.



Modified: flumotion/branches/platform-3/ChangeLog
==============================================================================
--- flumotion/branches/platform-3/ChangeLog	(original)
+++ flumotion/branches/platform-3/ChangeLog	Mon Jun 11 17:13:04 2007
@@ -6,6 +6,9 @@
 	(fixLogRotation): New method, fixes log rotation in a running
 	daemonized worker.
 	(getStackVar): ph34r
+	(fixLogRotation): Add more terror to make sure that an admin
+	doesn't call this function twice, or on a worker that does not
+	need it.
 
 2007-06-11  Michael Smith <msmith at fluendo.com>
 

Modified: flumotion/branches/platform-3/flumotion/worker/checks/fixes.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/worker/checks/fixes.py	(original)
+++ flumotion/branches/platform-3/flumotion/worker/checks/fixes.py	Mon Jun 11 17:13:04 2007
@@ -16,6 +16,16 @@
     except ImportError:
         from flumotion.worker.worker import WorkerMedium
 
+    try:
+        from flumotion.extern.log import log
+    except ImportError:
+        from flumotion.common import log
+
+    if hasattr(log, '_old_hup_handler'):
+        return 'fixing not needed'
+    log.outputToFiles(log._stdout, log._stderr)
+    log._old_hup_handler = None
+
     self = getStackVar('self', WorkerMedium)
     if hasattr(self.brain, '_installHUPHandler'):
         self.brain._installHUPHandler()


More information about the flumotion-commit mailing list