You can now set the PASTE_CONFIG environment variable to control logging setup
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 25 Feb 2013 18:15:12 +0000 (12:15 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 25 Feb 2013 18:15:12 +0000 (12:15 -0600)
So this should work:

  PASTE_CONFIG=/path/to/paste_foo.ini ./lazycelery.sh

Thanks to Laurent Fournier for sponsoring this commit!

mediagoblin/init/celery/from_celery.py

index 29037d10bc05b390425d72f8230d36dba0321c4b..5c99ddff07952d52466c83808c118fd6f9452b41 100644 (file)
@@ -35,6 +35,11 @@ def setup_logging_from_paste_ini(loglevel, **kw):
     else:
         logging_conf_file = 'paste.ini'
 
+    # allow users to set up explicitly which paste file to check via the
+    # PASTE_CONFIG environment variable
+    logging_conf_file = os.environ.get(
+        'PASTE_CONFIG', logging_conf_file)
+
     if not os.path.exists(logging_conf_file):
         raise IOError('{0} does not exist. Logging can not be set up.'.format(
             logging_conf_file))