diff options
| author | Barry Warsaw | 2008-03-22 21:43:38 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2008-03-22 21:43:38 -0400 |
| commit | 78aeaf14e41c473655267d8a0fad175c783012e7 (patch) | |
| tree | 6a65a11c73c163299860d07409212e8215fe9165 /mailman/bin/qrunner.py | |
| parent | 6d9084326a4470da44c15193ddf0c4573fccb7f9 (diff) | |
| download | mailman-78aeaf14e41c473655267d8a0fad175c783012e7.tar.gz mailman-78aeaf14e41c473655267d8a0fad175c783012e7.tar.zst mailman-78aeaf14e41c473655267d8a0fad175c783012e7.zip | |
Diffstat (limited to 'mailman/bin/qrunner.py')
| -rw-r--r-- | mailman/bin/qrunner.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/mailman/bin/qrunner.py b/mailman/bin/qrunner.py index 0b9c823a1..e78dfab4e 100644 --- a/mailman/bin/qrunner.py +++ b/mailman/bin/qrunner.py @@ -19,11 +19,9 @@ import sys import signal import logging -from mailman import Version from mailman import loginit from mailman.configuration import config from mailman.i18n import _ -from mailman.initialize import initialize from mailman.options import Options @@ -55,7 +53,7 @@ def r_callback(option, opt, value, parser): -class RunnerOptions(Options): +class ScriptOptions(Options): usage=_("""\ Run one or more qrunners, once or repeatedly. @@ -114,6 +112,10 @@ This should only be used when running qrunner as a subprocess of the mailmanctl startup script. It changes some of the exit-on-error behavior to work better with that framework.""")) + def initialize(self): + """Override initialization to propagate logs correctly.""" + super(ScriptOptions, self).initialize(not self.options.subproc) + def sanity_check(self): if self.arguments: self.parser.error(_('Unexpected arguments')) @@ -198,13 +200,8 @@ def set_signals(loop): def main(): global log - options = RunnerOptions() - # If we're not running as a subprocess of mailmanctl, then we'll log to - # stderr in addition to logging to the log files. We do this by passing a - # value of True to propagate, which allows the 'mailman' root logger to - # see the log messages. - initialize(options.options.config, - propagate_logs=not options.options.subproc) + options = ScriptOptions() + options.initialize() if options.options.list: prefixlen = max(len(shortname) |
