From e477eafa458e9f76d2ad1b38540f2b3cc97a7d80 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 12 Dec 2017 13:30:33 +0900 Subject: [PATCH] django2: Replace django.core.urlresolves with django.urls (In Django 2.0) The django.core.urlresolvers module is removed in favor of its new location, django.urls. It was depreacted in Django 1.10: https://docs.djangoproject.com/en/2.0/releases/1.10/#id3 blueprint django2-support Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26 --- horizon/base.py | 2 +- horizon/forms/fields.py | 10 +++++----- horizon/tables/actions.py | 8 ++++---- horizon/tables/base.py | 6 +++--- horizon/templatetags/branding.py | 2 +- horizon/test/unit/tables/test_tables.py | 2 +- horizon/test/unit/test_base.py | 6 +++--- horizon/workflows/base.py | 6 +++--- openstack_auth/tests/unit/test_auth.py | 2 +- .../contrib/developer/profiler/middleware.py | 2 +- .../dashboards/admin/aggregates/tests.py | 2 +- .../dashboards/admin/aggregates/views.py | 2 +- .../dashboards/admin/defaults/tests.py | 2 +- .../dashboards/admin/flavors/tables.py | 2 +- .../dashboards/admin/flavors/tests.py | 2 +- .../dashboards/admin/flavors/views.py | 2 +- .../dashboards/admin/floating_ips/forms.py | 2 +- .../dashboards/admin/floating_ips/tests.py | 2 +- .../dashboards/admin/floating_ips/views.py | 4 ++-- .../admin/hypervisors/compute/forms.py | 2 +- .../admin/hypervisors/compute/tests.py | 2 +- .../admin/hypervisors/compute/views.py | 4 ++-- .../dashboards/admin/hypervisors/tests.py | 2 +- .../dashboards/admin/images/tests.py | 2 +- .../dashboards/admin/images/views.py | 4 ++-- .../dashboards/admin/info/tables.py | 6 +++--- .../dashboards/admin/info/tests.py | 2 +- .../dashboards/admin/instances/forms.py | 2 +- .../dashboards/admin/instances/tables.py | 6 +++--- .../dashboards/admin/instances/tests.py | 2 +- .../dashboards/admin/instances/views.py | 4 ++-- .../dashboards/admin/metadata_defs/forms.py | 2 +- .../dashboards/admin/metadata_defs/tests.py | 2 +- .../dashboards/admin/metadata_defs/views.py | 4 ++-- .../dashboards/admin/networks/agents/forms.py | 2 +- .../admin/networks/agents/tables.py | 2 +- .../dashboards/admin/networks/agents/tests.py | 2 +- .../dashboards/admin/networks/agents/views.py | 2 +- .../dashboards/admin/networks/forms.py | 2 +- .../dashboards/admin/networks/ports/tables.py | 2 +- .../dashboards/admin/networks/ports/tests.py | 2 +- .../dashboards/admin/networks/ports/views.py | 2 +- .../admin/networks/ports/workflows.py | 2 +- .../admin/networks/subnets/tables.py | 4 ++-- .../admin/networks/subnets/tests.py | 2 +- .../admin/networks/subnets/views.py | 2 +- .../admin/networks/subnets/workflows.py | 2 +- .../dashboards/admin/networks/tests.py | 2 +- .../dashboards/admin/networks/views.py | 2 +- .../dashboards/admin/networks/workflows.py | 2 +- .../dashboards/admin/overview/tests.py | 2 +- .../dashboards/admin/routers/forms.py | 2 +- .../dashboards/admin/routers/tests.py | 2 +- .../dashboards/admin/routers/views.py | 2 +- .../dashboards/admin/snapshots/forms.py | 2 +- .../dashboards/admin/snapshots/tabs.py | 2 +- .../dashboards/admin/snapshots/tests.py | 2 +- .../dashboards/admin/snapshots/views.py | 4 ++-- .../admin/volume_types/extras/forms.py | 2 +- .../admin/volume_types/extras/tables.py | 2 +- .../admin/volume_types/extras/tests.py | 2 +- .../admin/volume_types/extras/views.py | 4 ++-- .../dashboards/admin/volume_types/forms.py | 2 +- .../admin/volume_types/qos_specs/forms.py | 2 +- .../admin/volume_types/qos_specs/tables.py | 2 +- .../admin/volume_types/qos_specs/tests.py | 2 +- .../admin/volume_types/qos_specs/views.py | 2 +- .../dashboards/admin/volume_types/tables.py | 2 +- .../dashboards/admin/volume_types/tests.py | 2 +- .../dashboards/admin/volume_types/views.py | 4 ++-- .../dashboards/admin/volumes/forms.py | 2 +- .../dashboards/admin/volumes/tests.py | 2 +- .../dashboards/admin/volumes/views.py | 4 ++-- .../dashboards/identity/domains/tables.py | 2 +- .../dashboards/identity/domains/tests.py | 2 +- .../dashboards/identity/domains/views.py | 2 +- .../dashboards/identity/domains/workflows.py | 2 +- .../dashboards/identity/groups/tables.py | 2 +- .../dashboards/identity/groups/tests.py | 2 +- .../dashboards/identity/groups/views.py | 4 ++-- .../identity_providers/protocols/tables.py | 2 +- .../identity_providers/protocols/tests.py | 2 +- .../identity_providers/protocols/views.py | 2 +- .../identity/identity_providers/tests.py | 2 +- .../identity/identity_providers/views.py | 4 ++-- .../dashboards/identity/mappings/tests.py | 2 +- .../dashboards/identity/mappings/views.py | 4 ++-- .../dashboards/identity/projects/tables.py | 2 +- .../dashboards/identity/projects/tests.py | 2 +- .../dashboards/identity/projects/views.py | 2 +- .../dashboards/identity/projects/workflows.py | 2 +- .../dashboards/identity/roles/tests.py | 2 +- .../dashboards/identity/roles/views.py | 4 ++-- .../dashboards/identity/users/tests.py | 2 +- .../dashboards/identity/users/views.py | 4 ++-- .../dashboards/project/api_access/tests.py | 2 +- .../dashboards/project/api_access/views.py | 2 +- .../dashboards/project/backups/forms.py | 2 +- .../dashboards/project/backups/tables.py | 2 +- .../dashboards/project/backups/tabs.py | 2 +- .../dashboards/project/backups/tests.py | 2 +- .../dashboards/project/backups/views.py | 4 ++-- .../dashboards/project/cg_snapshots/forms.py | 2 +- .../dashboards/project/cg_snapshots/tabs.py | 2 +- .../dashboards/project/cg_snapshots/tests.py | 2 +- .../dashboards/project/cg_snapshots/views.py | 4 ++-- .../dashboards/project/cgroups/forms.py | 2 +- .../dashboards/project/cgroups/tabs.py | 2 +- .../dashboards/project/cgroups/tests.py | 2 +- .../dashboards/project/cgroups/views.py | 4 ++-- .../dashboards/project/floating_ips/tables.py | 2 +- .../dashboards/project/floating_ips/tests.py | 2 +- .../dashboards/project/floating_ips/views.py | 2 +- .../project/floating_ips/workflows.py | 2 +- .../project/images/images/tables.py | 2 +- .../dashboards/project/images/images/tests.py | 2 +- .../dashboards/project/images/images/views.py | 4 ++-- .../project/images/snapshots/forms.py | 2 +- .../project/images/snapshots/tests.py | 2 +- .../project/images/snapshots/views.py | 4 ++-- .../dashboards/project/images/tests.py | 2 +- .../dashboards/project/instances/forms.py | 2 +- .../dashboards/project/instances/tables.py | 20 +++++++++---------- .../dashboards/project/instances/tabs.py | 2 +- .../dashboards/project/instances/tests.py | 2 +- .../dashboards/project/instances/views.py | 4 ++-- .../dashboards/project/key_pairs/tables.py | 4 ++-- .../dashboards/project/key_pairs/tests.py | 2 +- .../dashboards/project/key_pairs/views.py | 4 ++-- .../project/network_topology/tests.py | 2 +- .../project/network_topology/views.py | 4 ++-- .../dashboards/project/networks/forms.py | 2 +- .../extensions/allowed_address_pairs/forms.py | 2 +- .../allowed_address_pairs/tables.py | 2 +- .../extensions/allowed_address_pairs/views.py | 2 +- .../project/networks/ports/tables.py | 2 +- .../project/networks/ports/tests.py | 2 +- .../project/networks/ports/views.py | 2 +- .../project/networks/ports/workflows.py | 2 +- .../project/networks/subnets/tables.py | 4 ++-- .../project/networks/subnets/tests.py | 2 +- .../project/networks/subnets/views.py | 2 +- .../project/networks/subnets/workflows.py | 2 +- .../dashboards/project/networks/tests.py | 2 +- .../dashboards/project/networks/views.py | 4 ++-- .../dashboards/project/networks/workflows.py | 2 +- .../dashboards/project/overview/tests.py | 2 +- .../routers/extensions/extraroutes/forms.py | 2 +- .../routers/extensions/extraroutes/tables.py | 2 +- .../routers/extensions/extraroutes/views.py | 2 +- .../dashboards/project/routers/forms.py | 4 ++-- .../dashboards/project/routers/ports/forms.py | 2 +- .../project/routers/ports/tables.py | 2 +- .../dashboards/project/routers/ports/tabs.py | 2 +- .../dashboards/project/routers/ports/views.py | 2 +- .../dashboards/project/routers/tables.py | 2 +- .../dashboards/project/routers/tests.py | 2 +- .../dashboards/project/routers/views.py | 4 ++-- .../project/security_groups/forms.py | 2 +- .../project/security_groups/tables.py | 2 +- .../project/security_groups/tests.py | 2 +- .../project/security_groups/views.py | 4 ++-- .../dashboards/project/snapshots/forms.py | 2 +- .../dashboards/project/snapshots/tables.py | 2 +- .../dashboards/project/snapshots/tabs.py | 2 +- .../dashboards/project/snapshots/tests.py | 2 +- .../dashboards/project/snapshots/views.py | 4 ++-- .../dashboards/project/volumes/forms.py | 2 +- .../dashboards/project/volumes/tables.py | 4 ++-- .../dashboards/project/volumes/tests.py | 2 +- .../dashboards/project/volumes/views.py | 4 ++-- .../dashboards/settings/password/tests.py | 2 +- .../dashboards/settings/password/views.py | 2 +- .../dashboards/settings/user/tests.py | 2 +- .../dashboards/settings/user/views.py | 2 +- openstack_dashboard/test/helpers.py | 4 ++-- openstack_dashboard/usage/tables.py | 4 ++-- openstack_dashboard/views.py | 6 +++--- 178 files changed, 240 insertions(+), 240 deletions(-) diff --git a/horizon/base.py b/horizon/base.py index 1cfdfa8bb8..6fac4ce8f5 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -32,7 +32,7 @@ from django.conf import settings from django.conf.urls import include from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import empty from django.utils.functional import SimpleLazyObject diff --git a/horizon/forms/fields.py b/horizon/forms/fields.py index 79f5c45885..334d86f288 100644 --- a/horizon/forms/fields.py +++ b/horizon/forms/fields.py @@ -21,12 +21,12 @@ import six from oslo_utils import uuidutils from django.core.exceptions import ValidationError -from django.core import urlresolvers from django.forms import fields from django.forms import forms from django.forms.utils import flatatt from django.forms import widgets from django.template.loader import get_template +from django import urls from django.utils.encoding import force_text from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import Promise @@ -364,11 +364,11 @@ class DynamicSelectWidget(SelectWidget): return self.add_item_link() try: if self.add_item_link_args: - return urlresolvers.reverse(self.add_item_link, - args=self.add_item_link_args) + return urls.reverse(self.add_item_link, + args=self.add_item_link_args) else: - return urlresolvers.reverse(self.add_item_link) - except urlresolvers.NoReverseMatch: + return urls.reverse(self.add_item_link) + except urls.NoReverseMatch: return self.add_item_link diff --git a/horizon/tables/actions.py b/horizon/tables/actions.py index 906560acca..b3f07b90a2 100644 --- a/horizon/tables/actions.py +++ b/horizon/tables/actions.py @@ -20,9 +20,9 @@ import logging import types from django.conf import settings -from django.core import urlresolvers from django import shortcuts from django.template.loader import render_to_string +from django import urls from django.utils.functional import Promise from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ @@ -406,10 +406,10 @@ class LinkAction(BaseAction): try: if datum: obj_id = self.table.get_object_id(datum) - return urlresolvers.reverse(self.url, args=(obj_id,)) + return urls.reverse(self.url, args=(obj_id,)) else: - return urlresolvers.reverse(self.url) - except urlresolvers.NoReverseMatch as ex: + return urls.reverse(self.url) + except urls.NoReverseMatch as ex: LOG.info('No reverse found for "%(url)s": %(exception)s', {'url': self.url, 'exception': ex}) return self.url diff --git a/horizon/tables/base.py b/horizon/tables/base.py index 955dcd313c..65a02b91b5 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -22,13 +22,13 @@ import sys from django.conf import settings from django.core import exceptions as core_exceptions -from django.core import urlresolvers from django import forms from django.http import HttpResponse from django import template from django.template.defaultfilters import slugify from django.template.defaultfilters import truncatechars from django.template.loader import render_to_string +from django import urls from django.utils.html import escape from django.utils import http from django.utils.http import urlencode @@ -471,8 +471,8 @@ class Column(html.HTMLElement): return self.link(datum, request=self.table.request) return self.link(datum) try: - return urlresolvers.reverse(self.link, args=(obj_id,)) - except urlresolvers.NoReverseMatch: + return urls.reverse(self.link, args=(obj_id,)) + except urls.NoReverseMatch: return self.link if getattr(settings, 'INTEGRATION_TESTS_SUPPORT', False): diff --git a/horizon/templatetags/branding.py b/horizon/templatetags/branding.py index cfcf8545d8..cff2119432 100644 --- a/horizon/templatetags/branding.py +++ b/horizon/templatetags/branding.py @@ -21,8 +21,8 @@ Template tags for customizing Horizon. """ from django.conf import settings -from django.core.urlresolvers import reverse from django import template +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ diff --git a/horizon/test/unit/tables/test_tables.py b/horizon/test/unit/tables/test_tables.py index 0d556836d5..67b0813814 100644 --- a/horizon/test/unit/tables/test_tables.py +++ b/horizon/test/unit/tables/test_tables.py @@ -18,12 +18,12 @@ import unittest import uuid -from django.core.urlresolvers import reverse from django import forms from django import http from django import shortcuts from django.template import defaultfilters from django.test.utils import override_settings +from django.urls import reverse from django.utils.translation import ungettext_lazy import mock diff --git a/horizon/test/unit/test_base.py b/horizon/test/unit/test_base.py index abb64bb763..344c80444f 100644 --- a/horizon/test/unit/test_base.py +++ b/horizon/test/unit/test_base.py @@ -26,7 +26,7 @@ import django from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured -from django.core import urlresolvers +from django import urls import horizon from horizon import base @@ -125,7 +125,7 @@ class BaseHorizonTests(test.TestCase): Allows URLs to be re-calculated after registering new dashboards. Useful only for testing and should never be used on a live site. """ - urlresolvers.clear_url_caches() + urls.clear_url_caches() moves.reload_module(import_module(settings.ROOT_URLCONF)) base.Horizon._urls() @@ -226,7 +226,7 @@ class HorizonTests(BaseHorizonTests): cats = horizon.get_dashboard("cats") tigers = cats.get_panel("tigers") tigers.index_url_name = "does_not_exist" - with self.assertRaises(urlresolvers.NoReverseMatch): + with self.assertRaises(urls.NoReverseMatch): tigers.get_absolute_url() tigers.index_url_name = "index" self.assertEqual("/cats/tigers/", tigers.get_absolute_url()) diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py index 6e6ef1d358..c06d6f6b14 100644 --- a/horizon/workflows/base.py +++ b/horizon/workflows/base.py @@ -17,13 +17,13 @@ from importlib import import_module import inspect import logging -from django.core import urlresolvers from django import forms from django.forms.forms import NON_FIELD_ERRORS from django import template from django.template.defaultfilters import linebreaks from django.template.defaultfilters import safe from django.template.defaultfilters import slugify +from django import urls from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from openstack_auth import policy @@ -858,8 +858,8 @@ class Workflow(html.HTMLElement): or a standard HTTP URL. """ try: - return urlresolvers.reverse(self.success_url) - except urlresolvers.NoReverseMatch: + return urls.reverse(self.success_url) + except urls.NoReverseMatch: return self.success_url def format_status_message(self, message): diff --git a/openstack_auth/tests/unit/test_auth.py b/openstack_auth/tests/unit/test_auth.py index a087e54748..c48702c472 100644 --- a/openstack_auth/tests/unit/test_auth.py +++ b/openstack_auth/tests/unit/test_auth.py @@ -16,8 +16,8 @@ import uuid import django from django.conf import settings from django.contrib import auth -from django.core.urlresolvers import reverse from django import test +from django.urls import reverse from keystoneauth1 import exceptions as keystone_exceptions from keystoneauth1.identity import v2 as v2_auth from keystoneauth1.identity import v3 as v3_auth diff --git a/openstack_dashboard/contrib/developer/profiler/middleware.py b/openstack_dashboard/contrib/developer/profiler/middleware.py index 7fec15c992..ba55251287 100644 --- a/openstack_dashboard/contrib/developer/profiler/middleware.py +++ b/openstack_dashboard/contrib/developer/profiler/middleware.py @@ -15,7 +15,7 @@ from django.conf import settings from django.core import exceptions -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils import safestring from django.utils.translation import ugettext_lazy as _ from osprofiler import _utils as profiler_utils diff --git a/openstack_dashboard/dashboards/admin/aggregates/tests.py b/openstack_dashboard/dashboards/admin/aggregates/tests.py index af670e877e..22c18e04b0 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/tests.py +++ b/openstack_dashboard/dashboards/admin/aggregates/tests.py @@ -12,8 +12,8 @@ import mock -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils import html from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/aggregates/views.py b/openstack_dashboard/dashboards/admin/aggregates/views.py index 515739450e..acda8e7d2d 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/views.py +++ b/openstack_dashboard/dashboards/admin/aggregates/views.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/defaults/tests.py b/openstack_dashboard/dashboards/admin/defaults/tests.py index 1175540579..147bdd16f3 100644 --- a/openstack_dashboard/dashboards/admin/defaults/tests.py +++ b/openstack_dashboard/dashboards/admin/defaults/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/flavors/tables.py b/openstack_dashboard/dashboards/admin/flavors/tables.py index 5d2faf1870..e5c4d1a4cd 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tables.py +++ b/openstack_dashboard/dashboards/admin/flavors/tables.py @@ -17,8 +17,8 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/admin/flavors/tests.py b/openstack_dashboard/dashboards/admin/flavors/tests.py index 358abfb7b0..1176bb16ae 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tests.py +++ b/openstack_dashboard/dashboards/admin/flavors/tests.py @@ -12,8 +12,8 @@ import django from django.conf import settings -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from novaclient.v2 import flavors diff --git a/openstack_dashboard/dashboards/admin/flavors/views.py b/openstack_dashboard/dashboards/admin/flavors/views.py index 0ca15878ae..c8472bb733 100644 --- a/openstack_dashboard/dashboards/admin/flavors/views.py +++ b/openstack_dashboard/dashboards/admin/flavors/views.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/floating_ips/forms.py b/openstack_dashboard/dashboards/admin/floating_ips/forms.py index 182f720ccb..459e206211 100644 --- a/openstack_dashboard/dashboards/admin/floating_ips/forms.py +++ b/openstack_dashboard/dashboards/admin/floating_ips/forms.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/floating_ips/tests.py b/openstack_dashboard/dashboards/admin/floating_ips/tests.py index 10c0a3d1ae..c78602ffd8 100644 --- a/openstack_dashboard/dashboards/admin/floating_ips/tests.py +++ b/openstack_dashboard/dashboards/admin/floating_ips/tests.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/floating_ips/views.py b/openstack_dashboard/dashboards/admin/floating_ips/views.py index 766a592e27..02d4f14c30 100644 --- a/openstack_dashboard/dashboards/admin/floating_ips/views.py +++ b/openstack_dashboard/dashboards/admin/floating_ips/views.py @@ -15,8 +15,8 @@ from collections import OrderedDict -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ import netaddr diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py index f4f9de805f..2e9a6434bf 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/forms.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/tests.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/tests.py index a590db475c..d6d5bbfd0f 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/tests.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/views.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/views.py index fd7f213e19..c549111ff4 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/compute/views.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/hypervisors/tests.py b/openstack_dashboard/dashboards/admin/hypervisors/tests.py index 61cbcaa994..9b9ed40d50 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/tests.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/images/tests.py b/openstack_dashboard/dashboards/admin/images/tests.py index 3a75d1736e..b7b1307d70 100644 --- a/openstack_dashboard/dashboards/admin/images/tests.py +++ b/openstack_dashboard/dashboards/admin/images/tests.py @@ -13,8 +13,8 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django.test.utils import override_settings +from django.urls import reverse import mock diff --git a/openstack_dashboard/dashboards/admin/images/views.py b/openstack_dashboard/dashboards/admin/images/views.py index 52c8a23dad..2f9a733542 100644 --- a/openstack_dashboard/dashboards/admin/images/views.py +++ b/openstack_dashboard/dashboards/admin/images/views.py @@ -22,8 +22,8 @@ from oslo_utils import units from six.moves import builtins from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/info/tables.py b/openstack_dashboard/dashboards/admin/info/tables.py index 40894f0e0c..9e5b3ef4e4 100644 --- a/openstack_dashboard/dashboards/admin/info/tables.py +++ b/openstack_dashboard/dashboards/admin/info/tables.py @@ -11,9 +11,9 @@ # under the License. from django.conf import settings -from django.core import urlresolvers from django import template from django.template import defaultfilters as filters +from django import urls from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ @@ -196,8 +196,8 @@ class NetworkL3AgentRoutersLinkAction(tables.LinkAction): def get_link_url(self, datum=None): obj_id = datum.id - return urlresolvers.reverse("horizon:admin:routers:l3_agent_list", - args=(obj_id,)) + return urls.reverse("horizon:admin:routers:l3_agent_list", + args=(obj_id,)) class NetworkAgentsTable(tables.DataTable): diff --git a/openstack_dashboard/dashboards/admin/info/tests.py b/openstack_dashboard/dashboards/admin/info/tests.py index 9cbe86594c..8e1249fed4 100644 --- a/openstack_dashboard/dashboards/admin/info/tests.py +++ b/openstack_dashboard/dashboards/admin/info/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/instances/forms.py b/openstack_dashboard/dashboards/admin/instances/forms.py index 5002f593c1..a63fda2024 100644 --- a/openstack_dashboard/dashboards/admin/instances/forms.py +++ b/openstack_dashboard/dashboards/admin/instances/forms.py @@ -13,7 +13,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py index 808a972da1..85efeadc4a 100644 --- a/openstack_dashboard/dashboards/admin/instances/tables.py +++ b/openstack_dashboard/dashboards/admin/instances/tables.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core import urlresolvers from django.template.defaultfilters import title +from django import urls from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from keystoneclient import exceptions as keystone_exceptions @@ -209,8 +209,8 @@ class AdminInstancesTable(tables.DataTable): def user_link(datum): - return urlresolvers.reverse("horizon:identity:users:detail", - args=(datum.user_id,)) + return urls.reverse("horizon:identity:users:detail", + args=(datum.user_id,)) class AdminAuditTable(audit_tables.AuditTable): diff --git a/openstack_dashboard/dashboards/admin/instances/tests.py b/openstack_dashboard/dashboards/admin/instances/tests.py index 2340a1809f..f9851979b2 100644 --- a/openstack_dashboard/dashboards/admin/instances/tests.py +++ b/openstack_dashboard/dashboards/admin/instances/tests.py @@ -15,8 +15,8 @@ from collections import OrderedDict import uuid -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/instances/views.py b/openstack_dashboard/dashboards/admin/instances/views.py index ccccd7a95b..f98764fbf2 100644 --- a/openstack_dashboard/dashboards/admin/instances/views.py +++ b/openstack_dashboard/dashboards/admin/instances/views.py @@ -20,8 +20,8 @@ import futurist from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/forms.py b/openstack_dashboard/dashboards/admin/metadata_defs/forms.py index c33653c320..900311e138 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/forms.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/forms.py @@ -18,8 +18,8 @@ Forms for managing metadata. """ import json -from django.core.urlresolvers import reverse from django.forms import ValidationError +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/tests.py b/openstack_dashboard/dashboards/admin/metadata_defs/tests.py index 026d51f8de..6b321b9f4e 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/tests.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/tests.py @@ -16,8 +16,8 @@ import json -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA import six diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/views.py b/openstack_dashboard/dashboards/admin/metadata_defs/views.py index deda899fdd..495f0035cb 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/views.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/views.py @@ -14,8 +14,8 @@ import json -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/agents/forms.py b/openstack_dashboard/dashboards/admin/networks/agents/forms.py index 1f6ccca212..0c4ff4dbf0 100644 --- a/openstack_dashboard/dashboards/admin/networks/agents/forms.py +++ b/openstack_dashboard/dashboards/admin/networks/agents/forms.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/agents/tables.py b/openstack_dashboard/dashboards/admin/networks/agents/tables.py index 0c08736c63..b8961929a0 100644 --- a/openstack_dashboard/dashboards/admin/networks/agents/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/agents/tables.py @@ -14,8 +14,8 @@ import logging -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/admin/networks/agents/tests.py b/openstack_dashboard/dashboards/admin/networks/agents/tests.py index 7c2e4fdb77..ac26073065 100644 --- a/openstack_dashboard/dashboards/admin/networks/agents/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/agents/tests.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/networks/agents/views.py b/openstack_dashboard/dashboards/admin/networks/agents/views.py index 5e998fa0e2..140e2ec21c 100644 --- a/openstack_dashboard/dashboards/admin/networks/agents/views.py +++ b/openstack_dashboard/dashboards/admin/networks/agents/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/forms.py b/openstack_dashboard/dashboards/admin/networks/forms.py index b95bff26a2..0c4dd5fc32 100644 --- a/openstack_dashboard/dashboards/admin/networks/forms.py +++ b/openstack_dashboard/dashboards/admin/networks/forms.py @@ -15,7 +15,7 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/ports/tables.py b/openstack_dashboard/dashboards/admin/networks/ports/tables.py index 580afecc1a..10114aabf9 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/ports/tests.py b/openstack_dashboard/dashboards/admin/networks/ports/tests.py index eeedb9fbe1..cf049ab78b 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/tests.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/networks/ports/views.py b/openstack_dashboard/dashboards/admin/networks/ports/views.py index 21a81bcbc5..e707bf22bf 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/views.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from openstack_dashboard.dashboards.admin.networks.ports \ diff --git a/openstack_dashboard/dashboards/admin/networks/ports/workflows.py b/openstack_dashboard/dashboards/admin/networks/ports/workflows.py index 4cdc6f02ac..269184d9b0 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/workflows.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/workflows.py @@ -15,7 +15,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/tables.py b/openstack_dashboard/dashboards/admin/networks/subnets/tables.py index 9e9dadd8cb..707913cd52 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/tables.py @@ -14,8 +14,8 @@ import logging -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py index d31a8abf72..37809299f8 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from horizon.workflows import views diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/views.py b/openstack_dashboard/dashboards/admin/networks/subnets/views.py index 45edb5042b..03368f716c 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/views.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from openstack_dashboard.dashboards.project.networks.subnets \ import views as project_views diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/workflows.py b/openstack_dashboard/dashboards/admin/networks/subnets/workflows.py index 871b37988a..72e2521058 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/workflows.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/workflows.py @@ -14,7 +14,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/tests.py b/openstack_dashboard/dashboards/admin/networks/tests.py index 3f395336a0..a17a1ba036 100644 --- a/openstack_dashboard/dashboards/admin/networks/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/tests.py @@ -13,8 +13,8 @@ # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/networks/views.py b/openstack_dashboard/dashboards/admin/networks/views.py index dbb8131a16..6cc52d08d6 100644 --- a/openstack_dashboard/dashboards/admin/networks/views.py +++ b/openstack_dashboard/dashboards/admin/networks/views.py @@ -15,7 +15,7 @@ from collections import OrderedDict from django.conf import settings -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/networks/workflows.py b/openstack_dashboard/dashboards/admin/networks/workflows.py index d8925ae3ea..e1b9620635 100644 --- a/openstack_dashboard/dashboards/admin/networks/workflows.py +++ b/openstack_dashboard/dashboards/admin/networks/workflows.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from openstack_dashboard.dashboards.admin.networks import forms \ as networks_forms diff --git a/openstack_dashboard/dashboards/admin/overview/tests.py b/openstack_dashboard/dashboards/admin/overview/tests.py index 0d128030c6..ea2f1c352c 100644 --- a/openstack_dashboard/dashboards/admin/overview/tests.py +++ b/openstack_dashboard/dashboards/admin/overview/tests.py @@ -18,9 +18,9 @@ import datetime -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils import encoding from django.utils import timezone diff --git a/openstack_dashboard/dashboards/admin/routers/forms.py b/openstack_dashboard/dashboards/admin/routers/forms.py index 596b50b48c..23ebba31c7 100644 --- a/openstack_dashboard/dashboards/admin/routers/forms.py +++ b/openstack_dashboard/dashboards/admin/routers/forms.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from openstack_dashboard.dashboards.project.routers import forms as r_forms diff --git a/openstack_dashboard/dashboards/admin/routers/tests.py b/openstack_dashboard/dashboards/admin/routers/tests.py index 43a0d30674..f2f6e01ae1 100644 --- a/openstack_dashboard/dashboards/admin/routers/tests.py +++ b/openstack_dashboard/dashboards/admin/routers/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/routers/views.py b/openstack_dashboard/dashboards/admin/routers/views.py index c97fdce053..b4b3c8a379 100644 --- a/openstack_dashboard/dashboards/admin/routers/views.py +++ b/openstack_dashboard/dashboards/admin/routers/views.py @@ -17,7 +17,7 @@ Views for managing Neutron Routers. """ from django.conf import settings -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/snapshots/forms.py b/openstack_dashboard/dashboards/admin/snapshots/forms.py index b127a0db80..85bb082451 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/forms.py +++ b/openstack_dashboard/dashboards/admin/snapshots/forms.py @@ -11,7 +11,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/snapshots/tabs.py b/openstack_dashboard/dashboards/admin/snapshots/tabs.py index 177381c2d6..29b35e4f21 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/tabs.py +++ b/openstack_dashboard/dashboards/admin/snapshots/tabs.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import tabs diff --git a/openstack_dashboard/dashboards/admin/snapshots/tests.py b/openstack_dashboard/dashboards/admin/snapshots/tests.py index be3e9aab21..bf30c2e105 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/tests.py +++ b/openstack_dashboard/dashboards/admin/snapshots/tests.py @@ -11,9 +11,9 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/snapshots/views.py b/openstack_dashboard/dashboards/admin/snapshots/views.py index 74f3e8e953..3b9ac4d9ed 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/views.py +++ b/openstack_dashboard/dashboards/admin/snapshots/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/extras/forms.py b/openstack_dashboard/dashboards/admin/volume_types/extras/forms.py index 8c3d7261ec..cc7d4469f9 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/extras/forms.py +++ b/openstack_dashboard/dashboards/admin/volume_types/extras/forms.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/admin/volume_types/extras/tables.py b/openstack_dashboard/dashboards/admin/volume_types/extras/tables.py index 5a7519d8ba..1e6714cb47 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/extras/tables.py +++ b/openstack_dashboard/dashboards/admin/volume_types/extras/tables.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/admin/volume_types/extras/tests.py b/openstack_dashboard/dashboards/admin/volume_types/extras/tests.py index 9ccfe93560..d2c257adab 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/extras/tests.py +++ b/openstack_dashboard/dashboards/admin/volume_types/extras/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/volume_types/extras/views.py b/openstack_dashboard/dashboards/admin/volume_types/extras/views.py index 0515535e79..1284421e45 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/extras/views.py +++ b/openstack_dashboard/dashboards/admin/volume_types/extras/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/forms.py b/openstack_dashboard/dashboards/admin/volume_types/forms.py index cdacf94069..3ff8a1121c 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/forms.py +++ b/openstack_dashboard/dashboards/admin/volume_types/forms.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django.forms import ValidationError +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py index 0f1ecfe29d..eb503fff26 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py +++ b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tables.py b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tables.py index 1c58f67759..cf687b1ae1 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tables.py +++ b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tables.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tests.py b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tests.py index 60b985185e..d49ce01928 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tests.py +++ b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/views.py b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/views.py index 18c0500d46..10cba74d9c 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/qos_specs/views.py +++ b/openstack_dashboard/dashboards/admin/volume_types/qos_specs/views.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/tables.py b/openstack_dashboard/dashboards/admin/volume_types/tables.py index 7e3c63ac25..24e4c681ff 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/tables.py +++ b/openstack_dashboard/dashboards/admin/volume_types/tables.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/admin/volume_types/tests.py b/openstack_dashboard/dashboards/admin/volume_types/tests.py index 08a11c5d12..32102d08ac 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/tests.py +++ b/openstack_dashboard/dashboards/admin/volume_types/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volume_types/views.py b/openstack_dashboard/dashboards/admin/volume_types/views.py index 419c70486d..b4c0777722 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/views.py +++ b/openstack_dashboard/dashboards/admin/volume_types/views.py @@ -15,8 +15,8 @@ Admin views for managing volumes. """ from collections import OrderedDict -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volumes/forms.py b/openstack_dashboard/dashboards/admin/volumes/forms.py index bf1ae25bb3..aa719dcb28 100644 --- a/openstack_dashboard/dashboards/admin/volumes/forms.py +++ b/openstack_dashboard/dashboards/admin/volumes/forms.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/admin/volumes/tests.py b/openstack_dashboard/dashboards/admin/volumes/tests.py index 423f192282..1ab011fe89 100644 --- a/openstack_dashboard/dashboards/admin/volumes/tests.py +++ b/openstack_dashboard/dashboards/admin/volumes/tests.py @@ -15,8 +15,8 @@ import copy from django.conf import settings -from django.core.urlresolvers import reverse from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlunquote import mock diff --git a/openstack_dashboard/dashboards/admin/volumes/views.py b/openstack_dashboard/dashboards/admin/volumes/views.py index 7c096a18cf..f46f4f4b92 100644 --- a/openstack_dashboard/dashboards/admin/volumes/views.py +++ b/openstack_dashboard/dashboards/admin/volumes/views.py @@ -18,8 +18,8 @@ Admin views for managing volumes and snapshots. from collections import OrderedDict from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/domains/tables.py b/openstack_dashboard/dashboards/identity/domains/tables.py index 48297b1354..89fcf2aa3c 100644 --- a/openstack_dashboard/dashboards/identity/domains/tables.py +++ b/openstack_dashboard/dashboards/identity/domains/tables.py @@ -15,8 +15,8 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/identity/domains/tests.py b/openstack_dashboard/dashboards/identity/domains/tests.py index 7517315d1b..c3ed4d2410 100644 --- a/openstack_dashboard/dashboards/identity/domains/tests.py +++ b/openstack_dashboard/dashboards/identity/domains/tests.py @@ -13,8 +13,8 @@ # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/domains/views.py b/openstack_dashboard/dashboards/identity/domains/views.py index c3914facc1..eb63a6eaca 100644 --- a/openstack_dashboard/dashboards/identity/domains/views.py +++ b/openstack_dashboard/dashboards/identity/domains/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/domains/workflows.py b/openstack_dashboard/dashboards/identity/domains/workflows.py index 2f68452904..acf3dab4f5 100644 --- a/openstack_dashboard/dashboards/identity/domains/workflows.py +++ b/openstack_dashboard/dashboards/identity/domains/workflows.py @@ -15,7 +15,7 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from openstack_auth import utils diff --git a/openstack_dashboard/dashboards/identity/groups/tables.py b/openstack_dashboard/dashboards/identity/groups/tables.py index a6fad0cf4a..1e28c13e1a 100644 --- a/openstack_dashboard/dashboards/identity/groups/tables.py +++ b/openstack_dashboard/dashboards/identity/groups/tables.py @@ -14,8 +14,8 @@ import logging -from django.core.urlresolvers import reverse from django.template import defaultfilters +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/identity/groups/tests.py b/openstack_dashboard/dashboards/identity/groups/tests.py index 6b1e006e04..572bb2db1f 100644 --- a/openstack_dashboard/dashboards/identity/groups/tests.py +++ b/openstack_dashboard/dashboards/identity/groups/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/groups/views.py b/openstack_dashboard/dashboards/identity/groups/views.py index 1fb72cd1a1..ef3df9d29d 100644 --- a/openstack_dashboard/dashboards/identity/groups/views.py +++ b/openstack_dashboard/dashboards/identity/groups/views.py @@ -13,8 +13,8 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tables.py b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tables.py index 3fd6822f9f..15e5d1e3bc 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tables.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py index 144e45c022..9148550a74 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/identity_providers/protocols/views.py b/openstack_dashboard/dashboards/identity/identity_providers/protocols/views.py index 8735761164..b889f77e58 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/views.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/dashboards/identity/identity_providers/tests.py b/openstack_dashboard/dashboards/identity/identity_providers/tests.py index 81575458eb..25e4e2adb4 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/tests.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/identity_providers/views.py b/openstack_dashboard/dashboards/identity/identity_providers/views.py index f75abc3841..0936a41ee3 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/views.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/views.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/mappings/tests.py b/openstack_dashboard/dashboards/identity/mappings/tests.py index 9afa5d69ee..f76cbc683b 100644 --- a/openstack_dashboard/dashboards/identity/mappings/tests.py +++ b/openstack_dashboard/dashboards/identity/mappings/tests.py @@ -14,8 +14,8 @@ import json -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/mappings/views.py b/openstack_dashboard/dashboards/identity/mappings/views.py index ee45bc00c0..d7eb99f602 100644 --- a/openstack_dashboard/dashboards/identity/mappings/views.py +++ b/openstack_dashboard/dashboards/identity/mappings/views.py @@ -14,8 +14,8 @@ import json -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/projects/tables.py b/openstack_dashboard/dashboards/identity/projects/tables.py index b388690d41..2fca96e93d 100644 --- a/openstack_dashboard/dashboards/identity/projects/tables.py +++ b/openstack_dashboard/dashboards/identity/projects/tables.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py index 16dd161bf8..d5b6d91bd0 100644 --- a/openstack_dashboard/dashboards/identity/projects/tests.py +++ b/openstack_dashboard/dashboards/identity/projects/tests.py @@ -18,9 +18,9 @@ import os import unittest import django -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils import timezone from mox3.mox import IgnoreArg diff --git a/openstack_dashboard/dashboards/identity/projects/views.py b/openstack_dashboard/dashboards/identity/projects/views.py index 21d579f9ad..b6eca2ca8a 100644 --- a/openstack_dashboard/dashboards/identity/projects/views.py +++ b/openstack_dashboard/dashboards/identity/projects/views.py @@ -17,7 +17,7 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/projects/workflows.py b/openstack_dashboard/dashboards/identity/projects/workflows.py index 51e235c632..18c93b7b95 100644 --- a/openstack_dashboard/dashboards/identity/projects/workflows.py +++ b/openstack_dashboard/dashboards/identity/projects/workflows.py @@ -19,7 +19,7 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from openstack_auth import utils diff --git a/openstack_dashboard/dashboards/identity/roles/tests.py b/openstack_dashboard/dashboards/identity/roles/tests.py index 5be84fe33a..cb2ca99bd7 100644 --- a/openstack_dashboard/dashboards/identity/roles/tests.py +++ b/openstack_dashboard/dashboards/identity/roles/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/roles/views.py b/openstack_dashboard/dashboards/identity/roles/views.py index d5b86e28d7..eb74b83612 100644 --- a/openstack_dashboard/dashboards/identity/roles/views.py +++ b/openstack_dashboard/dashboards/identity/roles/views.py @@ -13,8 +13,8 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/identity/users/tests.py b/openstack_dashboard/dashboards/identity/users/tests.py index 5241de182d..c062cddf7f 100644 --- a/openstack_dashboard/dashboards/identity/users/tests.py +++ b/openstack_dashboard/dashboards/identity/users/tests.py @@ -19,9 +19,9 @@ from socket import timeout as socket_timeout import django -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/identity/users/views.py b/openstack_dashboard/dashboards/identity/users/views.py index da2166b3d9..45cbf4040c 100644 --- a/openstack_dashboard/dashboards/identity/users/views.py +++ b/openstack_dashboard/dashboards/identity/users/views.py @@ -20,8 +20,8 @@ import logging import operator from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters diff --git a/openstack_dashboard/dashboards/project/api_access/tests.py b/openstack_dashboard/dashboards/project/api_access/tests.py index c82e221442..f23ad161b4 100644 --- a/openstack_dashboard/dashboards/project/api_access/tests.py +++ b/openstack_dashboard/dashboards/project/api_access/tests.py @@ -16,11 +16,11 @@ from mox3.mox import IsA import six import yaml -from django.core.urlresolvers import reverse from django.http import HttpRequest from django import template from django.template import loader from django.test.utils import override_settings +from django.urls import reverse from openstack_dashboard import api from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/dashboards/project/api_access/views.py b/openstack_dashboard/dashboards/project/api_access/views.py index be3c30f05a..d9e56ef098 100644 --- a/openstack_dashboard/dashboards/project/api_access/views.py +++ b/openstack_dashboard/dashboards/project/api_access/views.py @@ -18,10 +18,10 @@ import tempfile import zipfile from django.conf import settings -from django.core.urlresolvers import reverse_lazy from django import http from django import shortcuts from django.template.loader import render_to_string +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from openstack_auth import utils diff --git a/openstack_dashboard/dashboards/project/backups/forms.py b/openstack_dashboard/dashboards/project/backups/forms.py index 4c92834be5..45f3178b9a 100644 --- a/openstack_dashboard/dashboards/project/backups/forms.py +++ b/openstack_dashboard/dashboards/project/backups/forms.py @@ -17,7 +17,7 @@ Views for managing backups. import operator -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/backups/tables.py b/openstack_dashboard/dashboards/project/backups/tables.py index 8c7b81c67a..e4ce2ec69a 100644 --- a/openstack_dashboard/dashboards/project/backups/tables.py +++ b/openstack_dashboard/dashboards/project/backups/tables.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils import html from django.utils import http from django.utils import safestring diff --git a/openstack_dashboard/dashboards/project/backups/tabs.py b/openstack_dashboard/dashboards/project/backups/tabs.py index 322e1cbf01..486fe0376a 100644 --- a/openstack_dashboard/dashboards/project/backups/tabs.py +++ b/openstack_dashboard/dashboards/project/backups/tabs.py @@ -11,7 +11,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/backups/tests.py b/openstack_dashboard/dashboards/project/backups/tests.py index c26e63017e..9b6e2ed93e 100644 --- a/openstack_dashboard/dashboards/project/backups/tests.py +++ b/openstack_dashboard/dashboards/project/backups/tests.py @@ -11,9 +11,9 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlencode from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/backups/views.py b/openstack_dashboard/dashboards/project/backups/views.py index 6cb2fbdc6b..997594f380 100644 --- a/openstack_dashboard/dashboards/project/backups/views.py +++ b/openstack_dashboard/dashboards/project/backups/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/cg_snapshots/forms.py b/openstack_dashboard/dashboards/project/cg_snapshots/forms.py index 338108702e..f54b779365 100644 --- a/openstack_dashboard/dashboards/project/cg_snapshots/forms.py +++ b/openstack_dashboard/dashboards/project/cg_snapshots/forms.py @@ -11,7 +11,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/cg_snapshots/tabs.py b/openstack_dashboard/dashboards/project/cg_snapshots/tabs.py index f1fc5231f7..4c9cd997b4 100644 --- a/openstack_dashboard/dashboards/project/cg_snapshots/tabs.py +++ b/openstack_dashboard/dashboards/project/cg_snapshots/tabs.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import tabs diff --git a/openstack_dashboard/dashboards/project/cg_snapshots/tests.py b/openstack_dashboard/dashboards/project/cg_snapshots/tests.py index 5bdf270ece..cca342234a 100644 --- a/openstack_dashboard/dashboards/project/cg_snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/cg_snapshots/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from openstack_dashboard.api import cinder diff --git a/openstack_dashboard/dashboards/project/cg_snapshots/views.py b/openstack_dashboard/dashboards/project/cg_snapshots/views.py index e2e14041b8..a7b205922a 100644 --- a/openstack_dashboard/dashboards/project/cg_snapshots/views.py +++ b/openstack_dashboard/dashboards/project/cg_snapshots/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/cgroups/forms.py b/openstack_dashboard/dashboards/project/cgroups/forms.py index db98134b4a..2dbd940005 100644 --- a/openstack_dashboard/dashboards/project/cgroups/forms.py +++ b/openstack_dashboard/dashboards/project/cgroups/forms.py @@ -11,7 +11,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/cgroups/tabs.py b/openstack_dashboard/dashboards/project/cgroups/tabs.py index a25abe3e61..83b4073ccd 100644 --- a/openstack_dashboard/dashboards/project/cgroups/tabs.py +++ b/openstack_dashboard/dashboards/project/cgroups/tabs.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import tabs diff --git a/openstack_dashboard/dashboards/project/cgroups/tests.py b/openstack_dashboard/dashboards/project/cgroups/tests.py index 44b4919aba..49109bfbb0 100644 --- a/openstack_dashboard/dashboards/project/cgroups/tests.py +++ b/openstack_dashboard/dashboards/project/cgroups/tests.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/cgroups/views.py b/openstack_dashboard/dashboards/project/cgroups/views.py index 17dc076c6a..18fb077cc9 100644 --- a/openstack_dashboard/dashboards/project/cgroups/views.py +++ b/openstack_dashboard/dashboards/project/cgroups/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/floating_ips/tables.py b/openstack_dashboard/dashboards/project/floating_ips/tables.py index 927178eb13..9e4e59ea2f 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/tables.py +++ b/openstack_dashboard/dashboards/project/floating_ips/tables.py @@ -15,8 +15,8 @@ import logging -from django.core.urlresolvers import reverse from django import shortcuts +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import pgettext_lazy from django.utils.translation import string_concat diff --git a/openstack_dashboard/dashboards/project/floating_ips/tests.py b/openstack_dashboard/dashboards/project/floating_ips/tests.py index 521740ce10..1f46d183b1 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/tests.py +++ b/openstack_dashboard/dashboards/project/floating_ips/tests.py @@ -17,8 +17,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils.http import urlencode from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/floating_ips/views.py b/openstack_dashboard/dashboards/project/floating_ips/views.py index fec4192c97..9e948d475d 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/views.py +++ b/openstack_dashboard/dashboards/project/floating_ips/views.py @@ -21,7 +21,7 @@ Views for managing floating IPs. """ -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from neutronclient.common import exceptions as neutron_exc diff --git a/openstack_dashboard/dashboards/project/floating_ips/workflows.py b/openstack_dashboard/dashboards/project/floating_ips/workflows.py index 147353cf51..fc79875528 100644 --- a/openstack_dashboard/dashboards/project/floating_ips/workflows.py +++ b/openstack_dashboard/dashboards/project/floating_ips/workflows.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from neutronclient.common import exceptions as neutron_exc diff --git a/openstack_dashboard/dashboards/project/images/images/tables.py b/openstack_dashboard/dashboards/project/images/images/tables.py index d816cd402a..b56b5f2965 100644 --- a/openstack_dashboard/dashboards/project/images/images/tables.py +++ b/openstack_dashboard/dashboards/project/images/images/tables.py @@ -15,8 +15,8 @@ from collections import defaultdict from django.conf import settings -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/images/images/tests.py b/openstack_dashboard/dashboards/project/images/images/tests.py index 0155ae8622..845acbd527 100644 --- a/openstack_dashboard/dashboards/project/images/images/tests.py +++ b/openstack_dashboard/dashboards/project/images/images/tests.py @@ -20,9 +20,9 @@ import tempfile from django.conf import settings from django.core.files.uploadedfile import InMemoryUploadedFile -from django.core.urlresolvers import reverse from django.forms.widgets import HiddenInput from django.test.utils import override_settings +from django.urls import reverse import mock import six diff --git a/openstack_dashboard/dashboards/project/images/images/views.py b/openstack_dashboard/dashboards/project/images/images/views.py index e43def5dc5..6336d84431 100644 --- a/openstack_dashboard/dashboards/project/images/images/views.py +++ b/openstack_dashboard/dashboards/project/images/images/views.py @@ -20,8 +20,8 @@ Views for managing images. """ from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/images/snapshots/forms.py b/openstack_dashboard/dashboards/project/images/snapshots/forms.py index ae47ca3c9d..50a659abae 100644 --- a/openstack_dashboard/dashboards/project/images/snapshots/forms.py +++ b/openstack_dashboard/dashboards/project/images/snapshots/forms.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/images/snapshots/tests.py b/openstack_dashboard/dashboards/project/images/snapshots/tests.py index 2755927c33..4e598d3ce2 100644 --- a/openstack_dashboard/dashboards/project/images/snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/images/snapshots/tests.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse import mock diff --git a/openstack_dashboard/dashboards/project/images/snapshots/views.py b/openstack_dashboard/dashboards/project/images/snapshots/views.py index 40b034ac06..ce3e15e7ac 100644 --- a/openstack_dashboard/dashboards/project/images/snapshots/views.py +++ b/openstack_dashboard/dashboards/project/images/snapshots/views.py @@ -19,8 +19,8 @@ """ Views for managing instance snapshots. """ -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/dashboards/project/images/tests.py b/openstack_dashboard/dashboards/project/images/tests.py index f618f78fc6..08dcfde9dd 100644 --- a/openstack_dashboard/dashboards/project/images/tests.py +++ b/openstack_dashboard/dashboards/project/images/tests.py @@ -21,8 +21,8 @@ import os from socket import timeout as socket_timeout import unittest -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse import mock from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/instances/forms.py b/openstack_dashboard/dashboards/project/instances/forms.py index 267b32f712..0b72844b17 100644 --- a/openstack_dashboard/dashboards/project/instances/forms.py +++ b/openstack_dashboard/dashboards/project/instances/forms.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django.template.defaultfilters import filesizeformat +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index 42f0b9f461..cc76326ee7 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -16,11 +16,11 @@ import logging from django.conf import settings -from django.core import urlresolvers from django.http import HttpResponse from django import shortcuts from django import template from django.template.defaultfilters import title +from django import urls from django.utils.http import urlencode from django.utils.safestring import mark_safe from django.utils.translation import npgettext_lazy @@ -429,7 +429,7 @@ class LaunchLinkNG(LaunchLink): classes = ("btn-launch", ) def get_default_attrs(self): - url = urlresolvers.reverse(self.url) + url = urls.reverse(self.url) ngclick = "modal.openLaunchInstanceWizard(" \ "{ successUrl: '%s' })" % url self.attrs.update({ @@ -454,7 +454,7 @@ class EditInstance(policy.PolicyTargetMixin, tables.LinkAction): return self._get_link_url(project, 'instance_info') def _get_link_url(self, project, step_slug): - base_url = urlresolvers.reverse(self.url, args=[project.id]) + base_url = urls.reverse(self.url, args=[project.id]) next_url = self.table.get_full_url() params = {"step": step_slug, update_instance.UpdateInstance.redirect_param_name: next_url} @@ -542,7 +542,7 @@ class ResizeLink(policy.PolicyTargetMixin, tables.LinkAction): return self._get_link_url(project, 'flavor_choice') def _get_link_url(self, project, step_slug): - base_url = urlresolvers.reverse(self.url, args=[project.id]) + base_url = urls.reverse(self.url, args=[project.id]) next_url = self.table.get_full_url() params = {"step": step_slug, resize_instance.ResizeInstance.redirect_param_name: next_url} @@ -596,7 +596,7 @@ class RebuildInstance(policy.PolicyTargetMixin, tables.LinkAction): def get_link_url(self, datum): instance_id = self.table.get_object_id(datum) - return urlresolvers.reverse(self.url, args=[instance_id]) + return urls.reverse(self.url, args=[instance_id]) class DecryptInstancePassword(tables.LinkAction): @@ -618,8 +618,8 @@ class DecryptInstancePassword(tables.LinkAction): def get_link_url(self, datum): instance_id = self.table.get_object_id(datum) keypair_name = get_keyname(datum) - return urlresolvers.reverse(self.url, args=[instance_id, - keypair_name]) + return urls.reverse(self.url, args=[instance_id, + keypair_name]) class AssociateIP(policy.PolicyTargetMixin, tables.LinkAction): @@ -646,7 +646,7 @@ class AssociateIP(policy.PolicyTargetMixin, tables.LinkAction): return not is_deleting(instance) def get_link_url(self, datum): - base_url = urlresolvers.reverse(self.url) + base_url = urls.reverse(self.url) next_url = self.table.get_full_url() params = { "instance_id": self.table.get_object_id(datum), @@ -953,7 +953,7 @@ class AttachInterface(policy.PolicyTargetMixin, tables.LinkAction): def get_link_url(self, datum): instance_id = self.table.get_object_id(datum) - return urlresolvers.reverse(self.url, args=[instance_id]) + return urls.reverse(self.url, args=[instance_id]) class DetachInterface(policy.PolicyTargetMixin, tables.LinkAction): @@ -979,7 +979,7 @@ class DetachInterface(policy.PolicyTargetMixin, tables.LinkAction): def get_link_url(self, datum): instance_id = self.table.get_object_id(datum) - return urlresolvers.reverse(self.url, args=[instance_id]) + return urls.reverse(self.url, args=[instance_id]) def get_ips(instance): diff --git a/openstack_dashboard/dashboards/project/instances/tabs.py b/openstack_dashboard/dashboards/project/instances/tabs.py index d6004b129d..3aac4600b8 100644 --- a/openstack_dashboard/dashboards/project/instances/tabs.py +++ b/openstack_dashboard/dashboards/project/instances/tabs.py @@ -13,7 +13,7 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py index c72f123aae..9a67c827d4 100644 --- a/openstack_dashboard/dashboards/project/instances/tests.py +++ b/openstack_dashboard/dashboards/project/instances/tests.py @@ -23,11 +23,11 @@ import sys import django from django.conf import settings -from django.core.urlresolvers import reverse from django.forms import widgets from django import http import django.test from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlencode from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py index b4f2084e6e..ab053b03c2 100644 --- a/openstack_dashboard/dashboards/project/instances/views.py +++ b/openstack_dashboard/dashboards/project/instances/views.py @@ -25,10 +25,10 @@ import logging import futurist from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy from django import http from django import shortcuts +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views import generic diff --git a/openstack_dashboard/dashboards/project/key_pairs/tables.py b/openstack_dashboard/dashboards/project/key_pairs/tables.py index b9662088cd..2c374a7147 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/tables.py +++ b/openstack_dashboard/dashboards/project/key_pairs/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core import urlresolvers +from django import urls from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy @@ -88,7 +88,7 @@ class CreateLinkNG(QuotaKeypairMixin, tables.LinkAction): policy_rules = (("compute", "os_compute_api:os-keypairs:create"),) def get_default_attrs(self): - url = urlresolvers.reverse(self.url) + url = urls.reverse(self.url) ngclick = "modal.createKeyPair({ successUrl: '%s' })" % url self.attrs.update({ 'ng-controller': 'KeypairController as modal', diff --git a/openstack_dashboard/dashboards/project/key_pairs/tests.py b/openstack_dashboard/dashboards/project/key_pairs/tests.py index f2cb618e2d..fe422d0a3e 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/tests.py +++ b/openstack_dashboard/dashboards/project/key_pairs/tests.py @@ -16,8 +16,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA import six diff --git a/openstack_dashboard/dashboards/project/key_pairs/views.py b/openstack_dashboard/dashboards/project/key_pairs/views.py index fb4a0598ae..0d3b959493 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/views.py +++ b/openstack_dashboard/dashboards/project/key_pairs/views.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/network_topology/tests.py b/openstack_dashboard/dashboards/project/network_topology/tests.py index 2aa5bc0337..e52cf6d91d 100644 --- a/openstack_dashboard/dashboards/project/network_topology/tests.py +++ b/openstack_dashboard/dashboards/project/network_topology/tests.py @@ -12,9 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http import django.test +from django.urls import reverse from mox3.mox import IsA from oslo_serialization import jsonutils diff --git a/openstack_dashboard/dashboards/project/network_topology/views.py b/openstack_dashboard/dashboards/project/network_topology/views.py index 87dc4696b0..979911c4d3 100644 --- a/openstack_dashboard/dashboards/project/network_topology/views.py +++ b/openstack_dashboard/dashboards/project/network_topology/views.py @@ -19,9 +19,9 @@ import json from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic import View diff --git a/openstack_dashboard/dashboards/project/networks/forms.py b/openstack_dashboard/dashboards/project/networks/forms.py index 4172b53bfe..8dbfbfa943 100644 --- a/openstack_dashboard/dashboards/project/networks/forms.py +++ b/openstack_dashboard/dashboards/project/networks/forms.py @@ -18,7 +18,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/forms.py b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/forms.py index 1ef8e5a9e1..cdc6f2d620 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/forms.py +++ b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/forms.py @@ -15,7 +15,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py index 1570351d3b..bdea189913 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py +++ b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py @@ -15,7 +15,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/views.py b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/views.py index bcae6eb801..e9bb5d6678 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/views.py +++ b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/views.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/dashboards/project/networks/ports/tables.py b/openstack_dashboard/dashboards/project/networks/ports/tables.py index c7f9ef2e76..427538b7c6 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/project/networks/ports/tables.py @@ -14,8 +14,8 @@ import logging -from django.core.urlresolvers import reverse from django import template +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/networks/ports/tests.py b/openstack_dashboard/dashboards/project/networks/ports/tests.py index 631d39fd92..48ef6b06ff 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/tests.py +++ b/openstack_dashboard/dashboards/project/networks/ports/tests.py @@ -15,8 +15,8 @@ import copy -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/networks/ports/views.py b/openstack_dashboard/dashboards/project/networks/ports/views.py index d41d8a9fdc..0ea87f761a 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/views.py +++ b/openstack_dashboard/dashboards/project/networks/ports/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/ports/workflows.py b/openstack_dashboard/dashboards/project/networks/ports/workflows.py index 23ddad1700..0a21145341 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/ports/workflows.py @@ -16,7 +16,7 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/subnets/tables.py b/openstack_dashboard/dashboards/project/networks/subnets/tables.py index 219709021e..052062c96d 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/tables.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/tables.py @@ -16,8 +16,8 @@ import logging from neutronclient.common import exceptions as neutron_exceptions -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/networks/subnets/tests.py b/openstack_dashboard/dashboards/project/networks/subnets/tests.py index a2fa6ee7ef..4aff99cf3c 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/tests.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/tests.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IsA from horizon.workflows import views diff --git a/openstack_dashboard/dashboards/project/networks/subnets/views.py b/openstack_dashboard/dashboards/project/networks/subnets/views.py index 48aeb599b3..0ab085da38 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/views.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/views.py @@ -15,7 +15,7 @@ """ Views for managing Neutron Subnets. """ -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/subnets/workflows.py b/openstack_dashboard/dashboards/project/networks/subnets/workflows.py index 1202dcc3be..ae7dd9cd5a 100644 --- a/openstack_dashboard/dashboards/project/networks/subnets/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/subnets/workflows.py @@ -14,7 +14,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/tests.py b/openstack_dashboard/dashboards/project/networks/tests.py index bc72432781..c4f222db22 100644 --- a/openstack_dashboard/dashboards/project/networks/tests.py +++ b/openstack_dashboard/dashboards/project/networks/tests.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils.html import escape from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/networks/views.py b/openstack_dashboard/dashboards/project/networks/views.py index 7fb49c9b5f..5799a5c706 100644 --- a/openstack_dashboard/dashboards/project/networks/views.py +++ b/openstack_dashboard/dashboards/project/networks/views.py @@ -16,8 +16,8 @@ Views for managing Neutron Networks. """ from django.conf import settings -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/networks/workflows.py b/openstack_dashboard/dashboards/project/networks/workflows.py index 58a397444e..c9d23e8a5f 100644 --- a/openstack_dashboard/dashboards/project/networks/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/workflows.py @@ -16,7 +16,7 @@ import logging from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ import netaddr diff --git a/openstack_dashboard/dashboards/project/overview/tests.py b/openstack_dashboard/dashboards/project/overview/tests.py index 3459ae2f42..29aa49a948 100644 --- a/openstack_dashboard/dashboards/project/overview/tests.py +++ b/openstack_dashboard/dashboards/project/overview/tests.py @@ -19,9 +19,9 @@ import datetime import logging -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils import timezone from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/forms.py b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/forms.py index bf8001dbf0..75956466e2 100644 --- a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/forms.py +++ b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/forms.py @@ -15,7 +15,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from neutronclient.common import exceptions as neutron_exc diff --git a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/tables.py b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/tables.py index 10e1cdbf4a..0ee5c12c65 100644 --- a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/tables.py +++ b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/tables.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/views.py b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/views.py index 5939011ff9..79e8a3b939 100644 --- a/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/views.py +++ b/openstack_dashboard/dashboards/project/routers/extensions/extraroutes/views.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/routers/forms.py b/openstack_dashboard/dashboards/project/routers/forms.py index 08c75456b8..a1bc78ab65 100644 --- a/openstack_dashboard/dashboards/project/routers/forms.py +++ b/openstack_dashboard/dashboards/project/routers/forms.py @@ -18,8 +18,8 @@ Views for managing Neutron Routers. """ import logging -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/routers/ports/forms.py b/openstack_dashboard/dashboards/project/routers/ports/forms.py index fd15fa27c4..4a2730d306 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/forms.py +++ b/openstack_dashboard/dashboards/project/routers/ports/forms.py @@ -14,7 +14,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/routers/ports/tables.py b/openstack_dashboard/dashboards/project/routers/ports/tables.py index 60df3978bc..9303446214 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/tables.py +++ b/openstack_dashboard/dashboards/project/routers/ports/tables.py @@ -14,7 +14,7 @@ import logging -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/routers/ports/tabs.py b/openstack_dashboard/dashboards/project/routers/ports/tabs.py index dec47d55dc..d4aea2ac4a 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/tabs.py +++ b/openstack_dashboard/dashboards/project/routers/ports/tabs.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/routers/ports/views.py b/openstack_dashboard/dashboards/project/routers/ports/views.py index bdc0f3f4b1..ea18cac648 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/views.py +++ b/openstack_dashboard/dashboards/project/routers/ports/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/routers/tables.py b/openstack_dashboard/dashboards/project/routers/tables.py index 7266c08b51..9c24e868bb 100644 --- a/openstack_dashboard/dashboards/project/routers/tables.py +++ b/openstack_dashboard/dashboards/project/routers/tables.py @@ -14,8 +14,8 @@ import logging -from django.core.urlresolvers import reverse from django.template import defaultfilters as filters +from django.urls import reverse from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/routers/tests.py b/openstack_dashboard/dashboards/project/routers/tests.py index dced7861f4..c9423864df 100644 --- a/openstack_dashboard/dashboards/project/routers/tests.py +++ b/openstack_dashboard/dashboards/project/routers/tests.py @@ -14,8 +14,8 @@ import copy import django -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from mox3.mox import IgnoreArg from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/routers/views.py b/openstack_dashboard/dashboards/project/routers/views.py index 4c428f3305..35b65cd69e 100644 --- a/openstack_dashboard/dashboards/project/routers/views.py +++ b/openstack_dashboard/dashboards/project/routers/views.py @@ -19,8 +19,8 @@ Views for managing Neutron Routers. from collections import OrderedDict -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/security_groups/forms.py b/openstack_dashboard/dashboards/project/security_groups/forms.py index 4d85aa941f..731c6ef9da 100644 --- a/openstack_dashboard/dashboards/project/security_groups/forms.py +++ b/openstack_dashboard/dashboards/project/security_groups/forms.py @@ -19,8 +19,8 @@ import netaddr from django.conf import settings -from django.core.urlresolvers import reverse from django.forms import ValidationError +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ import six diff --git a/openstack_dashboard/dashboards/project/security_groups/tables.py b/openstack_dashboard/dashboards/project/security_groups/tables.py index e75fcbfe66..3872116efc 100644 --- a/openstack_dashboard/dashboards/project/security_groups/tables.py +++ b/openstack_dashboard/dashboards/project/security_groups/tables.py @@ -13,7 +13,7 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy import six diff --git a/openstack_dashboard/dashboards/project/security_groups/tests.py b/openstack_dashboard/dashboards/project/security_groups/tests.py index 520234c52c..95cce0b116 100644 --- a/openstack_dashboard/dashboards/project/security_groups/tests.py +++ b/openstack_dashboard/dashboards/project/security_groups/tests.py @@ -23,8 +23,8 @@ import six import django from django.conf import settings -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from horizon import exceptions from horizon import forms diff --git a/openstack_dashboard/dashboards/project/security_groups/views.py b/openstack_dashboard/dashboards/project/security_groups/views.py index 9f78f09570..5ba6e415cf 100644 --- a/openstack_dashboard/dashboards/project/security_groups/views.py +++ b/openstack_dashboard/dashboards/project/security_groups/views.py @@ -19,8 +19,8 @@ """ Views for managing instances. """ -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from neutronclient.common import exceptions as neutron_exc diff --git a/openstack_dashboard/dashboards/project/snapshots/forms.py b/openstack_dashboard/dashboards/project/snapshots/forms.py index 77c2f0cc82..0e36327f18 100644 --- a/openstack_dashboard/dashboards/project/snapshots/forms.py +++ b/openstack_dashboard/dashboards/project/snapshots/forms.py @@ -11,7 +11,7 @@ # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/snapshots/tables.py b/openstack_dashboard/dashboards/project/snapshots/tables.py index 068f9653f5..43f91cc9ff 100644 --- a/openstack_dashboard/dashboards/project/snapshots/tables.py +++ b/openstack_dashboard/dashboards/project/snapshots/tables.py @@ -13,7 +13,7 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/openstack_dashboard/dashboards/project/snapshots/tabs.py b/openstack_dashboard/dashboards/project/snapshots/tabs.py index 7fcd8b3299..47a7bea622 100644 --- a/openstack_dashboard/dashboards/project/snapshots/tabs.py +++ b/openstack_dashboard/dashboards/project/snapshots/tabs.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/openstack_dashboard/dashboards/project/snapshots/tests.py b/openstack_dashboard/dashboards/project/snapshots/tests.py index ec3a0511cc..747636c973 100644 --- a/openstack_dashboard/dashboards/project/snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/snapshots/tests.py @@ -17,9 +17,9 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlunquote from mox3.mox import IsA diff --git a/openstack_dashboard/dashboards/project/snapshots/views.py b/openstack_dashboard/dashboards/project/snapshots/views.py index b7517dcb6a..8746250502 100644 --- a/openstack_dashboard/dashboards/project/snapshots/views.py +++ b/openstack_dashboard/dashboards/project/snapshots/views.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/volumes/forms.py b/openstack_dashboard/dashboards/project/volumes/forms.py index 4efe2b1196..236022adfb 100644 --- a/openstack_dashboard/dashboards/project/volumes/forms.py +++ b/openstack_dashboard/dashboards/project/volumes/forms.py @@ -18,9 +18,9 @@ Views for managing volumes. """ from django.conf import settings -from django.core.urlresolvers import reverse from django.forms import ValidationError from django.template.defaultfilters import filesizeformat +from django.urls import reverse from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/project/volumes/tables.py b/openstack_dashboard/dashboards/project/volumes/tables.py index d57cf37e48..ecadc06411 100644 --- a/openstack_dashboard/dashboards/project/volumes/tables.py +++ b/openstack_dashboard/dashboards/project/volumes/tables.py @@ -13,10 +13,10 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import NoReverseMatch -from django.core.urlresolvers import reverse from django.http import HttpResponse from django.template import defaultfilters as filters +from django.urls import NoReverseMatch +from django.urls import reverse from django.utils import html from django.utils.http import urlencode from django.utils import safestring diff --git a/openstack_dashboard/dashboards/project/volumes/tests.py b/openstack_dashboard/dashboards/project/volumes/tests.py index 35de444b1a..7b16db1fe7 100644 --- a/openstack_dashboard/dashboards/project/volumes/tests.py +++ b/openstack_dashboard/dashboards/project/volumes/tests.py @@ -19,10 +19,10 @@ import six import django from django.conf import settings -from django.core.urlresolvers import reverse from django.forms import widgets from django.template.defaultfilters import slugify from django.test.utils import override_settings +from django.urls import reverse from django.utils.http import urlunquote from openstack_dashboard import api diff --git a/openstack_dashboard/dashboards/project/volumes/views.py b/openstack_dashboard/dashboards/project/volumes/views.py index f4a77d7c16..3bf3c2d62a 100644 --- a/openstack_dashboard/dashboards/project/volumes/views.py +++ b/openstack_dashboard/dashboards/project/volumes/views.py @@ -19,10 +19,10 @@ Views for managing volumes. from collections import OrderedDict import json -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy from django import shortcuts from django.template.defaultfilters import slugify +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.utils import encoding from django.utils.translation import ugettext_lazy as _ diff --git a/openstack_dashboard/dashboards/settings/password/tests.py b/openstack_dashboard/dashboards/settings/password/tests.py index b9b0a6fcdb..22d808172f 100644 --- a/openstack_dashboard/dashboards/settings/password/tests.py +++ b/openstack_dashboard/dashboards/settings/password/tests.py @@ -13,8 +13,8 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse from django import http +from django.urls import reverse from django.utils.six.moves.urllib.parse import urlsplit import mock diff --git a/openstack_dashboard/dashboards/settings/password/views.py b/openstack_dashboard/dashboards/settings/password/views.py index aaacf6f8dc..331bb4b047 100644 --- a/openstack_dashboard/dashboards/settings/password/views.py +++ b/openstack_dashboard/dashboards/settings/password/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/dashboards/settings/user/tests.py b/openstack_dashboard/dashboards/settings/user/tests.py index 5ecb5aa0af..54c49424d5 100644 --- a/openstack_dashboard/dashboards/settings/user/tests.py +++ b/openstack_dashboard/dashboards/settings/user/tests.py @@ -13,7 +13,7 @@ # under the License. from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from openstack_dashboard.test import helpers as test diff --git a/openstack_dashboard/dashboards/settings/user/views.py b/openstack_dashboard/dashboards/settings/user/views.py index e5a4aecbed..f8649c0271 100644 --- a/openstack_dashboard/dashboards/settings/user/views.py +++ b/openstack_dashboard/dashboards/settings/user/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py index 3f9acf4e2c..b1f54017e5 100644 --- a/openstack_dashboard/test/helpers.py +++ b/openstack_dashboard/test/helpers.py @@ -29,10 +29,10 @@ import django from django.conf import settings from django.contrib.messages.storage import default_storage from django.core.handlers import wsgi -from django.core import urlresolvers from django import http as http_request from django.test.client import RequestFactory from django.test import utils as django_test_utils +from django import urls from django.utils import http from cinderclient import client as cinder_client @@ -732,7 +732,7 @@ class PluginTestCase(TestCase): to be re-calculated after registering new dashboards. Useful only for testing and should never be used on a live site. """ - urlresolvers.clear_url_caches() + urls.clear_url_caches() moves.reload_module(import_module(settings.ROOT_URLCONF)) base.Horizon._urls() diff --git a/openstack_dashboard/usage/tables.py b/openstack_dashboard/usage/tables.py index e2b74144d3..e47eefb76f 100644 --- a/openstack_dashboard/usage/tables.py +++ b/openstack_dashboard/usage/tables.py @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core import urlresolvers from django.template.defaultfilters import floatformat +from django import urls from django.utils.translation import ugettext_lazy as _ from horizon import tables @@ -73,7 +73,7 @@ class GlobalUsageTable(BaseUsageTable): def get_instance_link(datum): view = "horizon:project:instances:detail" if datum.get('instance_id', False): - return urlresolvers.reverse(view, args=(datum.get('instance_id'),)) + return urls.reverse(view, args=(datum.get('instance_id'),)) else: return None diff --git a/openstack_dashboard/views.py b/openstack_dashboard/views.py index a1354b6808..22553017e3 100644 --- a/openstack_dashboard/views.py +++ b/openstack_dashboard/views.py @@ -16,9 +16,9 @@ from importlib import import_module import logging from django.conf import settings -from django.core import urlresolvers from django import http from django import shortcuts +from django import urls from django.utils.translation import ugettext as _ import django.views.decorators.vary from django.views.generic import TemplateView @@ -74,9 +74,9 @@ def splash(request): def get_url_with_pagination(request, marker_name, prev_marker_name, url_string, object_id=None): if object_id: - url = urlresolvers.reverse(url_string, args=(object_id,)) + url = urls.reverse(url_string, args=(object_id,)) else: - url = urlresolvers.reverse(url_string) + url = urls.reverse(url_string) marker = request.GET.get(marker_name, None) if marker: return "{}?{}".format(url,