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: I0f7a59d28f8611ccaf66143ea6cdf0a89cedf80f
This commit is contained in:
manchandavishal 2022-04-29 17:17:42 +05:30
parent 7f794a9f0b
commit 6289954907
4 changed files with 42 additions and 42 deletions

View File

@ -11,19 +11,19 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url # noqa from django.urls import re_path
from monitoring.alarmdefs import views from monitoring.alarmdefs import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^alarm/create$', re_path(r'^alarm/create$',
views.AlarmCreateView.as_view(), views.AlarmCreateView.as_view(),
name='alarm_create'), name='alarm_create'),
url(r'^(?P<id>[^/]+)/alarm_detail/$', re_path(r'^(?P<id>[^/]+)/alarm_detail/$',
views.AlarmDetailView.as_view(), views.AlarmDetailView.as_view(),
name='alarm_detail'), name='alarm_detail'),
url(r'^alarm/(?P<id>[^/]+)/alarm_edit/$', re_path(r'^alarm/(?P<id>[^/]+)/alarm_edit/$',
views.AlarmEditView.as_view(), views.AlarmEditView.as_view(),
name='alarm_edit') name='alarm_edit')
] ]

View File

@ -11,22 +11,22 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url # noqa from django.urls import re_path
from monitoring.alarms import views from monitoring.alarms import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^alarm/filter/$', re_path(r'^alarm/filter/$',
views.AlarmFilterView.as_view(), views.AlarmFilterView.as_view(),
name='alarm_filter'), name='alarm_filter'),
url(r'^alarm/(?P<service>[^/]+)/$', re_path(r'^alarm/(?P<service>[^/]+)/$',
views.AlarmServiceView.as_view(), views.AlarmServiceView.as_view(),
name='alarm'), name='alarm'),
url(r'^alarm/$', re_path(r'^alarm/$',
views.AlarmServiceView.as_view(), views.AlarmServiceView.as_view(),
name='alarm_all'), name='alarm_all'),
url(r'^history/(?P<name>[^/]+)/(?P<id>[^/]+)$', re_path(r'^history/(?P<name>[^/]+)/(?P<id>[^/]+)$',
views.AlarmHistoryView.as_view(), views.AlarmHistoryView.as_view(),
name='history') name='history')
] ]

View File

@ -11,16 +11,16 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url # noqa from django.urls import re_path
from monitoring.notifications import views from monitoring.notifications import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^notification_create$', re_path(r'^notification_create$',
views.NotificationCreateView.as_view(), views.NotificationCreateView.as_view(),
name='notification_create'), name='notification_create'),
url(r'^notification_edit/(?P<id>[^/]+)$', re_path(r'^notification_edit/(?P<id>[^/]+)$',
views.NotificationEditView.as_view(), views.NotificationEditView.as_view(),
name='notification_edit') name='notification_edit')
] ]

View File

@ -11,19 +11,19 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.conf.urls import url from django.urls import re_path
from monitoring.config import local_settings as settings from monitoring.config import local_settings as settings
from monitoring.overview import views from monitoring.overview import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),
url(r'^status', views.StatusView.as_view(), name='status'), re_path(r'^status', views.StatusView.as_view(), name='status'),
url(r'^proxy\/(?P<restpath>.*)$', views.MonascaProxyView.as_view()), re_path(r'^proxy\/(?P<restpath>.*)$', views.MonascaProxyView.as_view()),
url(r'^proxy', views.MonascaProxyView.as_view(), name='proxy'), re_path(r'^proxy', views.MonascaProxyView.as_view(), name='proxy'),
url(r'^logs_proxy(?P<url>.*)$', re_path(r'^logs_proxy(?P<url>.*)$',
views.KibanaProxyView.as_view( views.KibanaProxyView.as_view(base_url=settings.KIBANA_HOST),
base_url=settings.KIBANA_HOST), name='kibana_proxy' name='kibana_proxy'
) )
] ]