From bdc00ef34b700cb51c61d34035401ae6f1210c04 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Fri, 29 Apr 2022 17:12:01 +0530 Subject: [PATCH] Address RemovedInDjango40Warning In Django 3.1, django.conf.urls.url() is deprecated in favor of django.urls.re_path(). For more info see [1] These were already replaced in Horizon repo by [2]. [1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2 [2] https://review.opendev.org/c/openstack/horizon/+/827093 Change-Id: I738008187eb5ceae633f42eb0cedc774017ab79d --- zun_ui/content/container/capsules/urls.py | 4 ++-- zun_ui/content/container/containers/admin_urls.py | 8 ++++---- zun_ui/content/container/containers/urls.py | 8 ++++---- zun_ui/content/container/hosts/urls.py | 4 ++-- zun_ui/content/container/images/urls.py | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zun_ui/content/container/capsules/urls.py b/zun_ui/content/container/capsules/urls.py index bb215ee..e677f8b 100644 --- a/zun_ui/content/container/capsules/urls.py +++ b/zun_ui/content/container/capsules/urls.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import ugettext_lazy as _ from horizon.browsers import views title = _("Capsules") urlpatterns = [ - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/zun_ui/content/container/containers/admin_urls.py b/zun_ui/content/container/containers/admin_urls.py index ab6179a..78ab84c 100644 --- a/zun_ui/content/container/containers/admin_urls.py +++ b/zun_ui/content/container/containers/admin_urls.py @@ -10,14 +10,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import ugettext_lazy as _ from horizon.browsers import views from zun_ui.content.container.containers import views as zun_views title = _("Containers") urlpatterns = [ - url(r'^(?P[^/]+)/console', - zun_views.SerialConsoleView.as_view(), name='console'), - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/console', + zun_views.SerialConsoleView.as_view(), name='console'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/zun_ui/content/container/containers/urls.py b/zun_ui/content/container/containers/urls.py index ab6179a..78ab84c 100644 --- a/zun_ui/content/container/containers/urls.py +++ b/zun_ui/content/container/containers/urls.py @@ -10,14 +10,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import ugettext_lazy as _ from horizon.browsers import views from zun_ui.content.container.containers import views as zun_views title = _("Containers") urlpatterns = [ - url(r'^(?P[^/]+)/console', - zun_views.SerialConsoleView.as_view(), name='console'), - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path(r'^(?P[^/]+)/console', + zun_views.SerialConsoleView.as_view(), name='console'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/zun_ui/content/container/hosts/urls.py b/zun_ui/content/container/hosts/urls.py index c1e1ef5..d83bd8e 100644 --- a/zun_ui/content/container/hosts/urls.py +++ b/zun_ui/content/container/hosts/urls.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import ugettext_lazy as _ from horizon.browsers import views title = _("Hosts") urlpatterns = [ - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/zun_ui/content/container/images/urls.py b/zun_ui/content/container/images/urls.py index 2620e7f..11b09f9 100644 --- a/zun_ui/content/container/images/urls.py +++ b/zun_ui/content/container/images/urls.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf.urls import url +from django.urls import re_path from django.utils.translation import ugettext_lazy as _ from horizon.browsers import views title = _("Images") urlpatterns = [ - url('', views.AngularIndexView.as_view(title=title), name='index'), + re_path('', views.AngularIndexView.as_view(title=title), name='index'), ]