Error with the content of the Horizon dashboard tutorial at http://docs.openstack.org/developer/horizon/topics/table_actions.html#adding-the-url

Bug #1640427 reported by Varsha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Low
Varsha

Bug Description

This tutorial specifies the following changes to be made to urls.py file:

from django.conf.urls import url

from openstack_dashboard.dashboards.mydashboard.mypanel import views

urlpatterns = [,
    url(r'^$',
        views.IndexView.as_view(), name='index'),
    url(r'^(?P<instance_id>[^/]+)/create_snapshot/$',
        views.CreateSnapshotView.as_view(),
        name='create_snapshot'),
]

After this change has been made, and after I restart the httpd I get an error in the horizon_error.log as posted below:

__import__(name)
[:error] [pid 11724] [remote 172.22.225.42:0] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/mydashboard/mypanel/urls.py", line 6
[:error] [pid 11724] [remote 172.22.225.42:0] urlpatterns = [,
[:error] [pid 11724] [remote 172.22.225.42:0] ^
[:error] [pid 11724] [remote 172.22.225.42:0] SyntaxError: invalid syntax

To fix this issue, we need to remove the comma next to the opening square bracket in urlpatterns = [,
The resulting code should look like:

urlpatterns = [
    url(r'^$',
        views.IndexView.as_view(), name='index'),
    url(r'^(?P<instance_id>[^/]+)/create_snapshot/$',
        views.CreateSnapshotView.as_view(),
        name='create_snapshot'),
]

description: updated
Changed in horizon:
assignee: nobody → Varsha (varsha-jayaraj94)
status: New → In Progress
Changed in horizon:
status: In Progress → New
Changed in horizon:
importance: Undecided → Low
tags: added: low-hanging-fruit
Revision history for this message
Vishal Manchanda (vishalmanchanda) wrote :

This is already fixed in master branch. For more information please refer [1]. So marking it as invalid.

[1] https://github.com/openstack/horizon/blob/master/doc/source/contributor/tutorials/dashboard.rst#urls

Changed in horizon:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.