|
@@ -28,12 +28,6 @@ from celery.utils.imports import (
|
|
import_from_cwd, symbol_by_name, NotAPackage, find_module,
|
|
import_from_cwd, symbol_by_name, NotAPackage, find_module,
|
|
)
|
|
)
|
|
|
|
|
|
-ERROR_ENVVAR_NOT_SET = """\
|
|
|
|
-The environment variable {0!r} is not set,
|
|
|
|
-and as such the configuration could not be loaded.
|
|
|
|
-Please set this variable and make it point to
|
|
|
|
-a configuration module."""
|
|
|
|
-
|
|
|
|
_RACE_PROTECTION = False
|
|
_RACE_PROTECTION = False
|
|
CONFIG_INVALID_NAME = """\
|
|
CONFIG_INVALID_NAME = """\
|
|
Error: Module '{module}' doesn't exist, or it's not a valid \
|
|
Error: Module '{module}' doesn't exist, or it's not a valid \
|
|
@@ -66,7 +60,6 @@ class BaseLoader(object):
|
|
"""
|
|
"""
|
|
builtin_modules = frozenset()
|
|
builtin_modules = frozenset()
|
|
configured = False
|
|
configured = False
|
|
- error_envvar_not_set = ERROR_ENVVAR_NOT_SET
|
|
|
|
override_backends = {}
|
|
override_backends = {}
|
|
worker_initialized = False
|
|
worker_initialized = False
|
|
|
|
|
|
@@ -139,15 +132,6 @@ class BaseLoader(object):
|
|
def init_worker_process(self):
|
|
def init_worker_process(self):
|
|
self.on_worker_process_init()
|
|
self.on_worker_process_init()
|
|
|
|
|
|
- def config_from_envvar(self, variable_name, silent=False):
|
|
|
|
- module_name = os.environ.get(variable_name)
|
|
|
|
- if not module_name:
|
|
|
|
- if silent:
|
|
|
|
- return False
|
|
|
|
- raise ImproperlyConfigured(
|
|
|
|
- self.error_envvar_not_set.format(module_name))
|
|
|
|
- return self.config_from_object(module_name, silent=silent)
|
|
|
|
-
|
|
|
|
def config_from_object(self, obj, silent=False):
|
|
def config_from_object(self, obj, silent=False):
|
|
if isinstance(obj, string_t):
|
|
if isinstance(obj, string_t):
|
|
try:
|
|
try:
|