Fix incorrect django.conf.url patterns import

Remove Django patterns from code.
Patterns from django.conf.urls has been removed in Django 1.10.
Current Django version in devstack is 1.10.7
Remove global_settings.TEMPLATE_CONTEXT_PROCESSORS because this
variable has been removed in Django 1.10.

Story: 2001120
Task: 4811

Change-Id: I84a4aceb73abd37dab4acf43b9abf8b43c7f1625
This commit is contained in:
Adrian Czarnecki 2017-07-12 14:13:31 +02:00
parent ad53c456e1
commit eaeb997abd
6 changed files with 14 additions and 31 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,6 @@
import os
from django.conf import global_settings
from django.utils.translation import ugettext_lazy as _ # noqa
from horizon.test.settings import * # noqa
@ -26,10 +25,6 @@ TEMPLATE_DIRS = (
os.path.join(TEST_DIR, 'templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + [
'openstack_dashboard.context_processors.openstack',
]
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.auth',

View File

@ -16,12 +16,11 @@ from django.views import generic
import openstack_dashboard.urls
urlpatterns = urls.patterns(
'',
urlpatterns = [
urls.url(
r'^qunit_tuskar',
generic.TemplateView.as_view(
template_name="infrastructure/qunit.html"),
name='qunit_tests'),
urls.url(r'', urls.include(openstack_dashboard.urls))
)
]