From 627301d3055743e88b7c31af779a4035714071f8 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Wed, 30 Mar 2022 18:14:10 +0000 Subject: [PATCH] Use re_path instead of url In Django 3.1 url has been deprecated in favor of re_path [0] We are now using Django 3.2, so we should update our code with the re_path alias. This has been fixed in Horizon as well [1] [0] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2 [1] https://opendev.org/openstack/horizon/commit/d9266fd82c1f0acc6b7236a6dc9b7e510985eb13 Closes-Bug: #1967172 Change-Id: Ibb5d5b726a836738b616e42f2cd9c6ee49835e0f --- .../admin/security_services/urls.py | 6 ++-- .../admin/share_group_snapshots/urls.py | 8 ++--- .../admin/share_group_types/urls.py | 10 +++---- .../dashboards/admin/share_groups/urls.py | 8 ++--- .../dashboards/admin/share_instances/urls.py | 6 ++-- .../dashboards/admin/share_networks/urls.py | 6 ++-- .../dashboards/admin/share_servers/urls.py | 6 ++-- .../dashboards/admin/share_snapshots/urls.py | 6 ++-- .../dashboards/admin/share_types/urls.py | 10 +++---- manila_ui/dashboards/admin/shares/urls.py | 28 ++++++++--------- .../dashboards/admin/user_messages/urls.py | 6 ++-- .../project/security_services/urls.py | 10 +++---- .../project/share_group_snapshots/urls.py | 10 +++---- .../dashboards/project/share_groups/urls.py | 10 +++---- .../dashboards/project/share_networks/urls.py | 10 +++---- .../project/share_snapshots/urls.py | 14 ++++----- manila_ui/dashboards/project/shares/urls.py | 30 +++++++++---------- .../dashboards/project/user_messages/urls.py | 6 ++-- manila_ui/tests/urls.py | 5 ++-- 19 files changed, 98 insertions(+), 97 deletions(-) diff --git a/manila_ui/dashboards/admin/security_services/urls.py b/manila_ui/dashboards/admin/security_services/urls.py index 49f3b83e..8a498aba 100644 --- a/manila_ui/dashboards/admin/security_services/urls.py +++ b/manila_ui/dashboards/admin/security_services/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.security_services import views urlpatterns = [ - urls.url( + re_path( r'^$', views.SecurityServicesView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.SecurityServiceDetailView.as_view(), name='security_service_detail'), diff --git a/manila_ui/dashboards/admin/share_group_snapshots/urls.py b/manila_ui/dashboards/admin/share_group_snapshots/urls.py index 6eadb9f3..5e4fd34d 100644 --- a/manila_ui/dashboards/admin/share_group_snapshots/urls.py +++ b/manila_ui/dashboards/admin/share_group_snapshots/urls.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_group_snapshots import views from manila_ui import features @@ -21,15 +21,15 @@ from manila_ui import features if features.is_share_groups_enabled(): urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareGroupSnapshotsView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)/$', views.ShareGroupSnapshotDetailView.as_view(), name='detail'), - urls.url( + re_path( r'^(?P[^/]+)/reset_status$', views.ResetShareGroupSnapshotStatusView.as_view(), name='reset_status'), diff --git a/manila_ui/dashboards/admin/share_group_types/urls.py b/manila_ui/dashboards/admin/share_group_types/urls.py index 563a2c6b..baefd894 100644 --- a/manila_ui/dashboards/admin/share_group_types/urls.py +++ b/manila_ui/dashboards/admin/share_group_types/urls.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_group_types import views from manila_ui import features @@ -21,19 +21,19 @@ from manila_ui import features if features.is_share_groups_enabled(): urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareGroupTypesView.as_view(), name='index'), - urls.url( + re_path( r'^create$', views.CreateShareGroupTypeView.as_view(), name='create'), - urls.url( + re_path( r'^(?P[^/]+)/update$', views.UpdateShareGroupTypeView.as_view(), name='update'), - urls.url( + re_path( r'^(?P[^/]+)/manage_access$', views.ManageShareGroupTypeAccessView.as_view(), name='manage_access'), diff --git a/manila_ui/dashboards/admin/share_groups/urls.py b/manila_ui/dashboards/admin/share_groups/urls.py index ddc23897..9f97c50b 100644 --- a/manila_ui/dashboards/admin/share_groups/urls.py +++ b/manila_ui/dashboards/admin/share_groups/urls.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_groups import views from manila_ui import features @@ -21,15 +21,15 @@ from manila_ui import features if features.is_share_groups_enabled(): urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareGroupsView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)/$', views.ShareGroupDetailView.as_view(), name='detail'), - urls.url( + re_path( r'^(?P[^/]+)/reset_status$', views.ResetShareGroupStatusView.as_view(), name='reset_status'), diff --git a/manila_ui/dashboards/admin/share_instances/urls.py b/manila_ui/dashboards/admin/share_instances/urls.py index 03a673ae..c677bca1 100644 --- a/manila_ui/dashboards/admin/share_instances/urls.py +++ b/manila_ui/dashboards/admin/share_instances/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_instances import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareInstancesView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.ShareInstanceDetailView.as_view(), name='share_instance_detail'), diff --git a/manila_ui/dashboards/admin/share_networks/urls.py b/manila_ui/dashboards/admin/share_networks/urls.py index 2f612157..708346da 100644 --- a/manila_ui/dashboards/admin/share_networks/urls.py +++ b/manila_ui/dashboards/admin/share_networks/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_networks import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareNetworksView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.ShareNetworkDetailView.as_view(), name='share_network_detail'), diff --git a/manila_ui/dashboards/admin/share_servers/urls.py b/manila_ui/dashboards/admin/share_servers/urls.py index 0618e19c..af35ac68 100644 --- a/manila_ui/dashboards/admin/share_servers/urls.py +++ b/manila_ui/dashboards/admin/share_servers/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_servers import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareServersView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.ShareServerDetailView.as_view(), name='share_server_detail'), diff --git a/manila_ui/dashboards/admin/share_snapshots/urls.py b/manila_ui/dashboards/admin/share_snapshots/urls.py index 71c66df1..1b2d96bc 100644 --- a/manila_ui/dashboards/admin/share_snapshots/urls.py +++ b/manila_ui/dashboards/admin/share_snapshots/urls.py @@ -10,17 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_snapshots import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareSnapshotsView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.ShareSnapshotDetailView.as_view(), name='share_snapshot_detail'), diff --git a/manila_ui/dashboards/admin/share_types/urls.py b/manila_ui/dashboards/admin/share_types/urls.py index 30e4081c..c9a247ac 100644 --- a/manila_ui/dashboards/admin/share_types/urls.py +++ b/manila_ui/dashboards/admin/share_types/urls.py @@ -10,25 +10,25 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.share_types import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareTypesView.as_view(), name='index'), - urls.url( + re_path( r'^create_type$', views.CreateShareTypeView.as_view(), name='create_type'), - urls.url( + re_path( r'^update_type/(?P[^/]+)/extra_specs$', views.UpdateShareTypeView.as_view(), name='update_type'), - urls.url( + re_path( r'^manage_share_type_access/(?P[^/]+)$', views.ManageShareTypeAccessView.as_view(), name='manage_share_type_access'), diff --git a/manila_ui/dashboards/admin/shares/urls.py b/manila_ui/dashboards/admin/shares/urls.py index aedb0977..9013ba30 100644 --- a/manila_ui/dashboards/admin/shares/urls.py +++ b/manila_ui/dashboards/admin/shares/urls.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.shares.replicas import views as replica_views from manila_ui.dashboards.admin.shares import views @@ -18,19 +18,19 @@ from manila_ui import features urlpatterns = [ - urls.url( + re_path( r'^$', views.SharesView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)/$', views.DetailView.as_view(), name='detail'), - urls.url( + re_path( r'^manage$', views.ManageShareView.as_view(), name='manage'), - urls.url( + re_path( r'^unmanage/(?P[^/]+)$', views.UnmanageShareView.as_view(), name='unmanage'), @@ -38,23 +38,23 @@ urlpatterns = [ if features.is_replication_enabled(): urlpatterns.extend([ - urls.url( + re_path( r'^(?P[^/]+)/replicas/$', replica_views.ManageReplicasView.as_view(), name='manage_replicas'), - urls.url( + re_path( r'^replica/(?P[^/]+)$', replica_views.DetailReplicaView.as_view(), name='replica_detail'), - urls.url( + re_path( r'^replica/(?P[^/]+)/resync_replica$', replica_views.ResyncReplicaView.as_view(), name='resync_replica'), - urls.url( + re_path( r'^replica/(?P[^/]+)/reset_replica_status$', replica_views.ResetReplicaStatusView.as_view(), name='reset_replica_status'), - urls.url( + re_path( r'^replica/(?P[^/]+)/reset_replica_state$', replica_views.ResetReplicaStateView.as_view(), name='reset_replica_state'), @@ -62,19 +62,19 @@ if features.is_replication_enabled(): if features.is_migration_enabled(): urlpatterns.extend([ - urls.url( + re_path( r'^migration_start/(?P[^/]+)$', views.MigrationStartView.as_view(), name='migration_start'), - urls.url( + re_path( r'^migration_complete/(?P[^/]+)$', views.MigrationCompleteView.as_view(), name='migration_complete'), - urls.url( + re_path( r'^migration_cancel/(?P[^/]+)$', views.MigrationCancelView.as_view(), name='migration_cancel'), - urls.url( + re_path( r'^migration_get_progress/(?P[^/]+)$', views.MigrationGetProgressView.as_view(), name='migration_get_progress'), diff --git a/manila_ui/dashboards/admin/user_messages/urls.py b/manila_ui/dashboards/admin/user_messages/urls.py index b48acd41..d5f51c85 100644 --- a/manila_ui/dashboards/admin/user_messages/urls.py +++ b/manila_ui/dashboards/admin/user_messages/urls.py @@ -12,17 +12,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.admin.user_messages import views urlpatterns = [ - urls.url( + re_path( r'^$', views.UserMessagesAdminView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.UserMessagesAdminDetailView.as_view(), name='user_messages_detail'), diff --git a/manila_ui/dashboards/project/security_services/urls.py b/manila_ui/dashboards/project/security_services/urls.py index 0b2b8a19..4f8de968 100644 --- a/manila_ui/dashboards/project/security_services/urls.py +++ b/manila_ui/dashboards/project/security_services/urls.py @@ -12,25 +12,25 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.security_services import views urlpatterns = [ - urls.url( + re_path( r'^$', views.SecurityServicesView.as_view(), name='index'), - urls.url( + re_path( r'^create_security_service$', views.CreateView.as_view(), name='security_service_create'), - urls.url( + re_path( r'^(?P[^/]+)/update/$', views.UpdateView.as_view(), name='security_service_update'), - urls.url( + re_path( r'^(?P[^/]+)$', views.Detail.as_view(), name='security_service_detail'), diff --git a/manila_ui/dashboards/project/share_group_snapshots/urls.py b/manila_ui/dashboards/project/share_group_snapshots/urls.py index d0ff0376..9479be65 100644 --- a/manila_ui/dashboards/project/share_group_snapshots/urls.py +++ b/manila_ui/dashboards/project/share_group_snapshots/urls.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.share_group_snapshots import views from manila_ui import features @@ -21,19 +21,19 @@ from manila_ui import features if features.is_share_groups_enabled(): urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareGroupSnapshotsView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)/snapshot_create/$', views.CreateShareGroupSnapshotView.as_view(), name='create'), - urls.url( + re_path( r'^(?P[^/]+)/$', views.ShareGroupSnapshotDetailView.as_view(), name='detail'), - urls.url( + re_path( r'^(?P[^/]+)/update/$', views.UpdateShareGroupSnapshotView.as_view(), name='update'), diff --git a/manila_ui/dashboards/project/share_groups/urls.py b/manila_ui/dashboards/project/share_groups/urls.py index 41e7e742..4c83b05e 100644 --- a/manila_ui/dashboards/project/share_groups/urls.py +++ b/manila_ui/dashboards/project/share_groups/urls.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.share_groups import views from manila_ui import features @@ -21,19 +21,19 @@ from manila_ui import features if features.is_share_groups_enabled(): urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareGroupsView.as_view(), name='index'), - urls.url( + re_path( r'^create/$', views.ShareGroupCreateView.as_view(), name='create'), - urls.url( + re_path( r'^(?P[^/]+)/$', views.ShareGroupDetailView.as_view(), name='detail'), - urls.url( + re_path( r'^(?P[^/]+)/update/$', views.ShareGroupUpdateView.as_view(), name='update'), diff --git a/manila_ui/dashboards/project/share_networks/urls.py b/manila_ui/dashboards/project/share_networks/urls.py index 7a8a2899..b831438d 100644 --- a/manila_ui/dashboards/project/share_networks/urls.py +++ b/manila_ui/dashboards/project/share_networks/urls.py @@ -12,25 +12,25 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.share_networks import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareNetworksView.as_view(), name='index'), - urls.url( + re_path( r'^create_share_network$', views.Create.as_view(), name='share_network_create'), - urls.url( + re_path( r'^(?P[^/]+)/update$', views.Update.as_view(), name='share_network_update'), - urls.url( + re_path( r'^(?P[^/]+)$', views.Detail.as_view(), name='share_network_detail'), diff --git a/manila_ui/dashboards/project/share_snapshots/urls.py b/manila_ui/dashboards/project/share_snapshots/urls.py index 3162b0a8..60fb4370 100644 --- a/manila_ui/dashboards/project/share_snapshots/urls.py +++ b/manila_ui/dashboards/project/share_snapshots/urls.py @@ -12,33 +12,33 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.share_snapshots import views urlpatterns = [ - urls.url( + re_path( r'^$', views.ShareSnapshotsView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)/share_snapshot_create/$', views.CreateShareSnapshotView.as_view(), name='share_snapshot_create'), - urls.url( + re_path( r'^(?P[^/]+)/share_snapshot_edit/$', views.UpdateShareSnapshotView.as_view(), name='share_snapshot_edit'), - urls.url( + re_path( r'^(?P[^/]+)$', views.ShareSnapshotDetailView.as_view(), name='share_snapshot_detail'), - urls.url( + re_path( r'^(?P[^/]+)/share_snapshot_rules/$', views.ManageShareSnapshotRulesView.as_view(), name='share_snapshot_manage_rules'), - urls.url( + re_path( r'^(?P[^/]+)/share_snapshot_rule_add/$', views.AddShareSnapshotRuleView.as_view(), name='share_snapshot_rule_add'), diff --git a/manila_ui/dashboards/project/shares/urls.py b/manila_ui/dashboards/project/shares/urls.py index a1c33826..5bdd8963 100644 --- a/manila_ui/dashboards/project/shares/urls.py +++ b/manila_ui/dashboards/project/shares/urls.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.shares.replicas import views as replica_views from manila_ui.dashboards.project.shares import views as shares_views @@ -20,43 +20,43 @@ from manila_ui import features urlpatterns = [ - urls.url( + re_path( r'^$', shares_views.SharesView.as_view(), name='index'), - urls.url( + re_path( r'^create/$', shares_views.CreateView.as_view(), name='create'), - urls.url( + re_path( r'^(?P[^/]+)/rules/$', shares_views.ManageRulesView.as_view(), name='manage_rules'), - urls.url( + re_path( r'^(?P[^/]+)/rule_add/$', shares_views.AddRuleView.as_view(), name='rule_add'), - urls.url( + re_path( r'^rules/(?P[^/]+)/update_rule_metadata/$', shares_views.UpdateRuleMetadataView.as_view(), name='update_rule_metadata'), - urls.url( + re_path( r'^(?P[^/]+)/$', shares_views.DetailView.as_view(), name='detail'), - urls.url( + re_path( r'^(?P[^/]+)/update/$', shares_views.UpdateView.as_view(), name='update'), - urls.url( + re_path( r'^(?P[^/]+)/update_metadata/$', shares_views.UpdateMetadataView.as_view(), name='update_metadata'), - urls.url( + re_path( r'^(?P[^/]+)/resize/$', shares_views.ResizeView.as_view(), name='resize'), - urls.url( + re_path( r'^(?P[^/]+)/revert/$', shares_views.RevertView.as_view(), name='revert'), @@ -64,19 +64,19 @@ urlpatterns = [ if features.is_replication_enabled(): urlpatterns.extend([ - urls.url( + re_path( r'^(?P[^/]+)/create_replica/$', replica_views.CreateReplicaView.as_view(), name='create_replica'), - urls.url( + re_path( r'^(?P[^/]+)/replicas/$', replica_views.ManageReplicasView.as_view(), name='manage_replicas'), - urls.url( + re_path( r'^replica/(?P[^/]+)$', replica_views.DetailReplicaView.as_view(), name='replica_detail'), - urls.url( + re_path( r'^replica/(?P[^/]+)/set_replica_as_active$', replica_views.SetReplicaAsActiveView.as_view(), name='set_replica_as_active'), diff --git a/manila_ui/dashboards/project/user_messages/urls.py b/manila_ui/dashboards/project/user_messages/urls.py index 03be774b..83e5498a 100644 --- a/manila_ui/dashboards/project/user_messages/urls.py +++ b/manila_ui/dashboards/project/user_messages/urls.py @@ -12,17 +12,17 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import re_path from manila_ui.dashboards.project.user_messages import views urlpatterns = [ - urls.url( + re_path( r'^$', views.UserMessagesView.as_view(), name='index'), - urls.url( + re_path( r'^(?P[^/]+)$', views.UserMessagesDetailView.as_view(), name='user_messages_detail'), diff --git a/manila_ui/tests/urls.py b/manila_ui/tests/urls.py index cf28475d..c588ccb3 100644 --- a/manila_ui/tests/urls.py +++ b/manila_ui/tests/urls.py @@ -11,9 +11,10 @@ # License for the specific language governing permissions and limitations # under the License. -from django.conf import urls +from django.urls import include +from django.urls import re_path import openstack_dashboard.urls urlpatterns = [ - urls.url(r'', urls.include(openstack_dashboard.urls)) + re_path(r'', include(openstack_dashboard.urls)) ]