Merge "[Django 1.9] Stop using django.utils.importlib"
This commit is contained in:
commit
d37270189b
@ -35,9 +35,9 @@ from django.core.urlresolvers import reverse
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.functional import empty
|
||||
from django.utils.functional import SimpleLazyObject # noqa
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from django.utils.module_loading import module_has_submodule # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from importlib import import_module
|
||||
import six
|
||||
|
||||
from horizon import conf
|
||||
|
@ -16,7 +16,7 @@ import os
|
||||
|
||||
from django.core.management.base import CommandError # noqa
|
||||
from django.core.management.templates import TemplateCommand # noqa
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from importlib import import_module
|
||||
|
||||
import horizon
|
||||
|
||||
|
@ -16,7 +16,7 @@ import os
|
||||
|
||||
from django.core.management.base import CommandError # noqa
|
||||
from django.core.management.templates import TemplateCommand # noqa
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from importlib import import_module
|
||||
|
||||
import horizon
|
||||
|
||||
|
@ -21,7 +21,7 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import User # noqa
|
||||
from django.core.exceptions import ImproperlyConfigured # noqa
|
||||
from django.core import urlresolvers
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from importlib import import_module
|
||||
from six import moves
|
||||
|
||||
import six
|
||||
|
@ -24,8 +24,8 @@ from django.template.defaultfilters import linebreaks # noqa
|
||||
from django.template.defaultfilters import safe # noqa
|
||||
from django.template.defaultfilters import slugify # noqa
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from importlib import import_module
|
||||
import six
|
||||
|
||||
from horizon import base
|
||||
|
@ -16,7 +16,7 @@
|
||||
from django.conf import settings
|
||||
from django.core import urlresolvers
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.importlib import import_module # noqa
|
||||
from importlib import import_module
|
||||
from six import moves
|
||||
|
||||
from horizon import base
|
||||
|
@ -22,8 +22,6 @@ from functools import wraps # noqa
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from ceilometerclient.v2 import client as ceilometer_client
|
||||
from cinderclient import client as cinder_client
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.contrib.messages.storage import default_storage # noqa
|
||||
@ -31,10 +29,13 @@ from django.core.handlers import wsgi
|
||||
from django.core import urlresolvers
|
||||
from django.test.client import RequestFactory # noqa
|
||||
from django.test import utils as django_test_utils
|
||||
from django.utils.importlib import import_module # noqa
|
||||
|
||||
from ceilometerclient.v2 import client as ceilometer_client
|
||||
from cinderclient import client as cinder_client
|
||||
import glanceclient
|
||||
from heatclient import client as heat_client
|
||||
import httplib2
|
||||
from importlib import import_module
|
||||
from keystoneclient.v2_0 import client as keystone_client
|
||||
import mock
|
||||
from mox3 import mox
|
||||
|
@ -11,11 +11,10 @@
|
||||
# under the License.
|
||||
|
||||
import collections
|
||||
from importlib import import_module
|
||||
import logging
|
||||
import os
|
||||
import pkgutil
|
||||
|
||||
from django.utils import importlib
|
||||
import six
|
||||
|
||||
from horizon.utils import file_discovery as fd
|
||||
@ -27,7 +26,7 @@ def import_submodules(module):
|
||||
for loader, name, ispkg in pkgutil.iter_modules(module.__path__,
|
||||
module.__name__ + '.'):
|
||||
try:
|
||||
submodule = importlib.import_module(name)
|
||||
submodule = import_module(name)
|
||||
except ImportError as e:
|
||||
# FIXME: Make the errors non-fatal (do we want that?).
|
||||
logging.warning("Error importing %s" % name)
|
||||
@ -120,7 +119,7 @@ def update_dashboards(modules, horizon_config, installed_apps):
|
||||
|
||||
if config.get('AUTO_DISCOVER_STATIC_FILES', False):
|
||||
for _app in _apps:
|
||||
module = importlib.import_module(_app)
|
||||
module = import_module(_app)
|
||||
base_path = os.path.join(module.__path__[0], 'static/')
|
||||
fd.populate_horizon_config(horizon_config, base_path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user