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: I66118c1af551e69a2deabf87b37efa574233e93b
This commit is contained in:
manchandavishal 2022-04-29 16:21:26 +05:30
parent ed5462edac
commit cc41dedbc5
7 changed files with 58 additions and 55 deletions

View File

@ -12,18 +12,18 @@
# See the 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 disaster_recovery.actions import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^create/(?P<action_id>[^/]+)?$',
views.ActionWorkflowView.as_view(),
name='create'),
re_path(r'^create/(?P<action_id>[^/]+)?$',
views.ActionWorkflowView.as_view(),
name='create'),
url(r'^action/(?P<action_id>[^/]+)?$',
views.ActionView.as_view(),
name='action'),
re_path(r'^action/(?P<action_id>[^/]+)?$',
views.ActionView.as_view(),
name='action'),
]

View File

@ -16,13 +16,15 @@
URL patterns for the OpenStack Dashboard.
"""
from django.conf.urls import url
from django.urls import re_path
from disaster_recovery.api.rest import rest_api
urlpatterns = [
url(r'^api/clients/$', rest_api.Clients.as_view(), name="api_clients"),
url(r'^api/actions/$', rest_api.ActionList.as_view(), name="api_actions"),
url(r'^api/actions/job/(?P<job_id>[^/]+)?$',
rest_api.Actions.as_view(), name="api_actions_in_job"),
re_path(r'^api/clients/$', rest_api.Clients.as_view(),
name="api_clients"),
re_path(r'^api/actions/$', rest_api.ActionList.as_view(),
name="api_actions"),
re_path(r'^api/actions/job/(?P<job_id>[^/]+)?$',
rest_api.Actions.as_view(), name="api_actions_in_job"),
]

View File

@ -13,15 +13,16 @@
# limitations under the License.
from django.conf.urls import url
from django.urls import re_path
from disaster_recovery.backups import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<backup_id>[^/]*)$', views.DetailView.as_view(), name='detail'),
url(r'^restore/(?P<backup_id>.*)$',
views.RestoreView.as_view(),
name='restore'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
re_path(r'^(?P<backup_id>[^/]*)$', views.DetailView.as_view(),
name='detail'),
re_path(r'^restore/(?P<backup_id>.*)$',
views.RestoreView.as_view(),
name='restore'),
]

View File

@ -12,14 +12,14 @@
# See the 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 disaster_recovery.clients import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<client_id>[^/]+)?$',
views.ClientView.as_view(),
name='client'),
re_path(r'^(?P<client_id>[^/]+)?$',
views.ClientView.as_view(),
name='client'),
]

View File

@ -12,27 +12,27 @@
# See the 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 disaster_recovery.jobs import views
urlpatterns = [
url(r'^(?P<job_id>[^/]+)?$',
views.JobsView.as_view(),
name='index'),
re_path(r'^(?P<job_id>[^/]+)?$',
views.JobsView.as_view(),
name='index'),
url(r'^create/$',
views.JobWorkflowView.as_view(),
name='create'),
re_path(r'^create/$',
views.JobWorkflowView.as_view(),
name='create'),
url(r'^configure/(?P<job_id>[^/]+)?$',
views.JobWorkflowView.as_view(),
name='configure'),
re_path(r'^configure/(?P<job_id>[^/]+)?$',
views.JobWorkflowView.as_view(),
name='configure'),
url(r'^edit/(?P<job_id>[^/]+)?$',
views.EditJobWorkflowView.as_view(),
name='edit_job'),
re_path(r'^edit/(?P<job_id>[^/]+)?$',
views.EditJobWorkflowView.as_view(),
name='edit_job'),
url(r'^edit_actions/(?P<job_id>[^/]+)?$',
views.ActionsInJobView.as_view(),
name='edit_action'),
re_path(r'^edit_actions/(?P<job_id>[^/]+)?$',
views.ActionsInJobView.as_view(),
name='edit_action'),
]

View File

@ -12,25 +12,25 @@
# See the 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 disaster_recovery.sessions import views
urlpatterns = [
url(r'^(?P<session_id>[^/]+)?$',
views.SessionsView.as_view(),
name='index'),
re_path(r'^(?P<session_id>[^/]+)?$',
views.SessionsView.as_view(),
name='index'),
url(r'^attach_to_session/(?P<job_id>[^/]+)?$',
views.AttachToSessionWorkflow.as_view(),
name='attach'),
re_path(r'^attach_to_session/(?P<job_id>[^/]+)?$',
views.AttachToSessionWorkflow.as_view(),
name='attach'),
url(r'^create/$',
views.CreateSessionWorkflow.as_view(),
name='create'),
re_path(r'^create/$',
views.CreateSessionWorkflow.as_view(),
name='create'),
url(r'^edit/(?P<session_id>[^/]+)?$',
views.CreateSessionWorkflow.as_view(),
name='edit'),
re_path(r'^edit/(?P<session_id>[^/]+)?$',
views.CreateSessionWorkflow.as_view(),
name='edit'),
]

View File

@ -13,10 +13,10 @@
# limitations under the License.
from django.conf.urls import include
from django.conf.urls import url
from django.urls import re_path
import disaster_recovery.api.rest.urls as rest_urls
urlpatterns = [
url(r'', include(rest_urls)),
re_path(r'', include(rest_urls)),
]