[svn] commit: r1698 - /trunk/src/bin/bind10/bind10.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Apr 8 22:11:32 UTC 2010


Author: jinmei
Date: Thu Apr  8 22:11:32 2010
New Revision: 1698

Log:
make it selectable on ProcessInfo construction whether to keep stderr
(revision of r1690, in response to a comment on trac ticket #140)

Modified:
    trunk/src/bin/bind10/bind10.py.in

Modified: trunk/src/bin/bind10/bind10.py.in
==============================================================================
--- trunk/src/bin/bind10/bind10.py.in (original)
+++ trunk/src/bin/bind10/bind10.py.in Thu Apr  8 22:11:32 2010
@@ -108,10 +108,10 @@
             spawn_stdout = self.dev_null
         else:
             spawn_stdout = None
-        if options.verbose:
-            spawn_stderr = sys.stderr
+        if self.dev_null_stderr:
+            spawn_stderr = self.dev_null
         else:
-            spawn_stderr = spawn_stdout
+            spawn_stderr = None
         # Environment variables for the child process will be a copy of those
         # of the boss process with any additional specific variables given
         # on construction (self.env).
@@ -128,11 +128,13 @@
         self.pid = self.process.pid
         self.restart_schedule.set_run_start_time()
 
-    def __init__(self, name, args, env={}, dev_null_stdout=False):
+    def __init__(self, name, args, env={}, dev_null_stdout=False,
+                 dev_null_stderr=False):
         self.name = name 
         self.args = args
         self.env = env
         self.dev_null_stdout = dev_null_stdout
+        self.dev_null_stderr = dev_null_stderr
         self.restart_schedule = RestartSchedule()
         self._spawn()
 
@@ -218,7 +220,8 @@
             sys.stdout.write("Starting msgq using port %d\n" % 
                              self.c_channel_port)
         try:
-            c_channel = ProcessInfo("msgq", ["msgq"], c_channel_env, True)
+            c_channel = ProcessInfo("msgq", ["msgq"], c_channel_env, True,
+                                    not self.verbose)
         except Exception as e:
             return "Unable to start msgq; " + str(e)
         self.processes[c_channel.pid] = c_channel




More information about the bind10-changes mailing list