summaryrefslogtreecommitdiff
path: root/Mailman/bin
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/bin')
-rw-r--r--Mailman/bin/mailmanctl.py13
-rw-r--r--Mailman/bin/testall.py8
2 files changed, 14 insertions, 7 deletions
diff --git a/Mailman/bin/mailmanctl.py b/Mailman/bin/mailmanctl.py
index a91b5651b..0c83e3324 100644
--- a/Mailman/bin/mailmanctl.py
+++ b/Mailman/bin/mailmanctl.py
@@ -164,7 +164,7 @@ def kill_watcher(sig):
def get_lock_data():
# Return the hostname, pid, and tempfile
- fp = open(config.LOCKFILE)
+ fp = open(config.LOCK_FILE)
try:
filename = os.path.split(fp.read().strip())[1]
finally:
@@ -205,7 +205,7 @@ def acquire_lock_1(force):
# Force removal of lock first
lock._disown()
hostname, pid, tempfile = get_lock_data()
- os.unlink(config.LOCKFILE)
+ os.unlink(config.LOCK_FILE)
os.unlink(os.path.join(config.LOCK_DIR, tempfile))
return acquire_lock_1(force=False)
@@ -236,7 +236,7 @@ process on some other host may have acquired it. We can't test for stale
locks across host boundaries, so you'll have to do this manually. Or, if you
know the lock is stale, re-run mailmanctl with the -s flag.
-Lock file: $config.LOCKFILE
+Lock file: $config.LOCK_FILE
Lock host: $status
Exiting.""")
@@ -255,7 +255,10 @@ def start_runner(qrname, slice, count):
exe = os.path.join(config.BIN_DIR, 'qrunner')
# config.PYTHON, which is the absolute path to the Python interpreter,
# must be given as argv[0] due to Python's library search algorithm.
- os.execl(config.PYTHON, config.PYTHON, exe, rswitch, '-s')
+ args = [config.PYTHON, config.PYTHON, exe, rswitch, '-s']
+ if opts.config:
+ args.extend(['-C', opts.config])
+ os.execl(*args)
# Should never get here
raise RuntimeError, 'os.execl() failed'
@@ -304,7 +307,7 @@ def check_privs():
def main():
- global elog, qlog
+ global elog, qlog, opts
parser, opts, args = parseargs()
config.load(opts.config)
diff --git a/Mailman/bin/testall.py b/Mailman/bin/testall.py
index dae46b7ff..61b1cc7c7 100644
--- a/Mailman/bin/testall.py
+++ b/Mailman/bin/testall.py
@@ -23,8 +23,9 @@ import sys
import optparse
import unittest
+from Mailman import Version
from Mailman import loginit
-from Mailman import mm_cfg
+from Mailman.configuration import config
from Mailman.i18n import _
__i18n_templates__ = True
@@ -43,7 +44,7 @@ def v_callback(option, opt, value, parser):
def parseargs():
- parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+ parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
usage=_("""\
%prog [options] [tests]
@@ -63,6 +64,8 @@ Reduce verbosity by 1 (but not below 0)."""))
parser.add_option('-e', '--stderr',
default=False, action='store_true',
help=_('Propagate log errors to stderr.'))
+ parser.add_option('-C', '--config',
+ help=_('Alternative configuration file to use'))
opts, args = parser.parse_args()
return parser, opts, args
@@ -135,6 +138,7 @@ def main():
global basedir
parser, opts, args = parseargs()
+ config.load(opts.config)
if not args:
args = ['.']
loginit.initialize(propagate=opts.stderr)