Move mediagoblin.celery_setup -> mediagoblin.init.celery
As the first target of the new .init. submodule move celery_setup there. Quite straight forward, just a lot of places to change.
This commit is contained in:
parent
1b579e18d8
commit
073b61fe53
@ -150,7 +150,7 @@ celeryd in another window.
|
|||||||
|
|
||||||
Run::
|
Run::
|
||||||
|
|
||||||
CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_celery ./bin/celeryd
|
CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery ./bin/celeryd
|
||||||
|
|
||||||
|
|
||||||
Running the test suite
|
Running the test suite
|
||||||
|
@ -25,7 +25,7 @@ from mediagoblin.config import (
|
|||||||
read_mediagoblin_config, generate_validation_report)
|
read_mediagoblin_config, generate_validation_report)
|
||||||
from mediagoblin.db.open import setup_connection_and_db_from_config
|
from mediagoblin.db.open import setup_connection_and_db_from_config
|
||||||
from mediagoblin.mg_globals import setup_globals
|
from mediagoblin.mg_globals import setup_globals
|
||||||
from mediagoblin.celery_setup import setup_celery_from_config
|
from mediagoblin.init.celery import setup_celery_from_config
|
||||||
from mediagoblin.workbench import WorkbenchManager
|
from mediagoblin.workbench import WorkbenchManager
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import sys
|
|||||||
|
|
||||||
MANDATORY_CELERY_IMPORTS = ['mediagoblin.process_media']
|
MANDATORY_CELERY_IMPORTS = ['mediagoblin.process_media']
|
||||||
|
|
||||||
DEFAULT_SETTINGS_MODULE = 'mediagoblin.celery_setup.dummy_settings_module'
|
DEFAULT_SETTINGS_MODULE = 'mediagoblin.init.celery.dummy_settings_module'
|
||||||
|
|
||||||
|
|
||||||
def setup_celery_from_config(app_config, global_config,
|
def setup_celery_from_config(app_config, global_config,
|
@ -17,7 +17,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from mediagoblin import app, mg_globals
|
from mediagoblin import app, mg_globals
|
||||||
from mediagoblin.celery_setup import setup_celery_from_config
|
from mediagoblin.init.celery import setup_celery_from_config
|
||||||
|
|
||||||
|
|
||||||
OUR_MODULENAME = __name__
|
OUR_MODULENAME = __name__
|
@ -17,7 +17,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from mediagoblin.tests.tools import TEST_APP_CONFIG
|
from mediagoblin.tests.tools import TEST_APP_CONFIG
|
||||||
from mediagoblin.celery_setup.from_celery import setup_self
|
from mediagoblin.init.celery.from_celery import setup_self
|
||||||
|
|
||||||
|
|
||||||
OUR_MODULENAME = __name__
|
OUR_MODULENAME = __name__
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from mediagoblin import celery_setup
|
from mediagoblin.init import celery as celery_setup
|
||||||
from mediagoblin.config import read_mediagoblin_config
|
from mediagoblin.config import read_mediagoblin_config
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ email_debug_mode = true
|
|||||||
db_name = __mediagoblin_tests__
|
db_name = __mediagoblin_tests__
|
||||||
|
|
||||||
# Celery shouldn't be set up by the application as it's setup via
|
# Celery shouldn't be set up by the application as it's setup via
|
||||||
# mediagoblin.celery_setup.from_celery
|
# mediagoblin.init.celery.from_celery
|
||||||
celery_setup_elsewhere = true
|
celery_setup_elsewhere = true
|
||||||
|
|
||||||
[celery]
|
[celery]
|
||||||
|
@ -42,8 +42,8 @@ USER_DEV_DIRECTORIES_TO_SETUP = [
|
|||||||
|
|
||||||
BAD_CELERY_MESSAGE = """\
|
BAD_CELERY_MESSAGE = """\
|
||||||
Sorry, you *absolutely* must run nosetests with the
|
Sorry, you *absolutely* must run nosetests with the
|
||||||
mediagoblin.celery_setup.from_tests module. Like so:
|
mediagoblin.init.celery.from_tests module. Like so:
|
||||||
$ CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests ./bin/nosetests"""
|
$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/nosetests"""
|
||||||
|
|
||||||
|
|
||||||
class BadCeleryEnviron(Exception): pass
|
class BadCeleryEnviron(Exception): pass
|
||||||
@ -51,7 +51,7 @@ class BadCeleryEnviron(Exception): pass
|
|||||||
|
|
||||||
def suicide_if_bad_celery_environ():
|
def suicide_if_bad_celery_environ():
|
||||||
if not os.environ.get('CELERY_CONFIG_MODULE') == \
|
if not os.environ.get('CELERY_CONFIG_MODULE') == \
|
||||||
'mediagoblin.celery_setup.from_tests':
|
'mediagoblin.init.celery.from_tests':
|
||||||
raise BadCeleryEnviron(BAD_CELERY_MESSAGE)
|
raise BadCeleryEnviron(BAD_CELERY_MESSAGE)
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ def get_test_app(dump_old_app=True):
|
|||||||
suicide_if_bad_celery_environ()
|
suicide_if_bad_celery_environ()
|
||||||
|
|
||||||
# Leave this imported as it sets up celery.
|
# Leave this imported as it sets up celery.
|
||||||
from mediagoblin.celery_setup import from_tests
|
from mediagoblin.init.celery import from_tests
|
||||||
|
|
||||||
global MGOBLIN_APP
|
global MGOBLIN_APP
|
||||||
|
|
||||||
|
@ -27,4 +27,4 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests $NOSETESTS $@
|
CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests $NOSETESTS $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user