From a8b8be8ad7510c095c3232c25f2c2e3e54d44352 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 16 Oct 2011 15:31:28 -0400 Subject: * `bin/mailman start --force` option is fixed. (LP: #869317) * acquire_lock_1(): No need to unlink the tempfile * Start.process(): Don't print error message when the lock is in stale_lock or host_mismatch status and --force has been given. * control.rst: Refactor test code into test_control.py. * test_create.py: To more accurately mimic argparse, FakeParser.error() needs to `sys.exit(1)`. The `SystemExit` must also be caught in the appropriate tests. * logging.py: Locking is now down by the flufl.lock package, so apply the `mailman.lock` configuration to it. --- src/mailman/commands/cli_control.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands/cli_control.py') diff --git a/src/mailman/commands/cli_control.py b/src/mailman/commands/cli_control.py index 2caaff54e..b2dc1bdd0 100644 --- a/src/mailman/commands/cli_control.py +++ b/src/mailman/commands/cli_control.py @@ -101,8 +101,10 @@ class Start: if status is WatcherState.conflict: self.parser.error(_('GNU Mailman is already running')) elif status in (WatcherState.stale_lock, WatcherState.host_mismatch): - self.parser.error(_('A previous run of GNU Mailman did not exit ' - 'cleanly. Try using --force.')) + if args.force is None: + self.parser.error( + _('A previous run of GNU Mailman did not exit ' + 'cleanly. Try using --force.')) def log(message): if not args.quiet: print message -- cgit v1.2.3-70-g09d2