From cf6e714bc3c68a8b9d788370fbdee4df6764e936 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 16 Feb 2010 17:17:38 -0500 Subject: Oh FFS. lazr.restful 0.9.18 totally broke our shit by introducing multiversioned web services. In concept, that's a great idea, but in (current as of 0.9.18) practice it sucks because it /forces/ us to adopt multiversions when really I could care less. After gobs of painful experimentation, this passes all the tests. I guess that means it's right . Another, more reasonable fix is to re-order when logging is initialized. This is moved to the start of initialize_2() because in the test environment, we don't want to initialize the loggers until after the test configuration has been pushed. Otherwise, because of the changes to support the FHS, logging will go to the wrong place. This really only affects tests, since in operational mode, initialize always happens immediately one after another. --- src/mailman/core/initialize.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/mailman/core/initialize.py') diff --git a/src/mailman/core/initialize.py b/src/mailman/core/initialize.py index 7c03a61db..e55e97ee5 100644 --- a/src/mailman/core/initialize.py +++ b/src/mailman/core/initialize.py @@ -87,19 +87,15 @@ def search_for_configuration_file(): # initialization, but before database initialization. Generally all other # code will just call initialize(). -def initialize_1(config_path=None, propagate_logs=None): +def initialize_1(config_path=None): """First initialization step. * Zope component architecture * The configuration system * Run-time directories - * The logging subsystem - * Internationalization :param config_path: The path to the configuration file. :type config_path: string - :param propagate_logs: Should the log output propagate to stderr? - :type propagate_logs: boolean or None """ zcml = resource_string('mailman.config', 'configure.zcml') xmlconfig.string(zcml) @@ -119,13 +115,12 @@ def initialize_1(config_path=None, propagate_logs=None): # For the test suite, force this back to not using a config file. config_path = None mailman.config.config.load(config_path) - # Create the queue and log directories if they don't already exist. - mailman.core.logging.initialize(propagate_logs) -def initialize_2(debug=False): +def initialize_2(debug=False, propagate_logs=None): """Second initialization step. + * Logging * Pre-hook * Rules * Chains @@ -134,7 +129,11 @@ def initialize_2(debug=False): :param debug: Should the database layer be put in debug mode? :type debug: boolean + :param propagate_logs: Should the log output propagate to stderr? + :type propagate_logs: boolean or None """ + # Create the queue and log directories if they don't already exist. + mailman.core.logging.initialize(propagate_logs) # Run the pre-hook if there is one. config = mailman.config.config if config.mailman.pre_hook: @@ -172,6 +171,6 @@ def initialize_3(): def initialize(config_path=None, propagate_logs=None): - initialize_1(config_path, propagate_logs) - initialize_2() + initialize_1(config_path) + initialize_2(propagate_logs=propagate_logs) initialize_3() -- cgit v1.2.3-70-g09d2