Project panels (like Networks panel) can't be actually disabled

Bug #1321865 reported by Pavel A.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Medium
Unassigned

Bug Description

I'm trying to disable the Networks panel for project dashboard. Putting like:
PANEL = 'networks'
PANEL_DASHBOARD = 'project'
PANEL_GROUP = 'network'
REMOVE_PANEL = True

to local/enabled works perfect but after that the networks panel under Admin panel group got broken.

Django Version: 1.4.5
Exception Type: TemplateSyntaxError
Exception Value:

project/networks/_network_ips.html

Exception Location: /usr/lib/python2.7/dist-packages/django/template/loader.py in find_template, line 138
Python Executable: /usr/bin/python

Though, the same works with images panel in spite there are also references to project like :

from openstack_dashboard.dashboards.project.images.images import views

Akihiro Motoki (amotoki)
Changed in horizon:
status: New → Triaged
importance: Undecided → Medium
milestone: none → juno-3
Revision history for this message
Akihiro Motoki (amotoki) wrote :

The bug occurs because admin network tables use a template from project dashboard but the template in the project network panel is not properly configured due to disabling the networking panel. [1][2] The easiest way to fix it seems to redefine get_subnet in admin/networks/tables.py.

We have the similar situation in get_ips and get_size in admin/instances/tables.py.

[1] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/dashboards/admin/networks/tables.py#n86
[2] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/dashboards/project/networks/tables.py#n109

tags: added: neutron
Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
Pavel A. (vpaul) wrote :

yes, the bug occurs because of admin dashboard uses some parts from project including network tables.

In my case I've managed with permissions trick like:

projects_dashboard = horizon.get_dashboard("project")
networks_panel = projects_dashboard.get_panel("networks")

permissions = list(getattr(networks_panel, 'permissions', []))
permissions.append('openstack.roles.admin')
networks_panel.permissions = tuple(permissions)

Though, it should be revised I suppose.

Akihiro Motoki (amotoki)
tags: removed: neutron
Revision history for this message
Akihiro Motoki (amotoki) wrote :

It seems complicated than I expected.

Many admin panel depends on corresponding project panel.
In addition to the report bug, instance detail and network detail pages also cannot be rendered due to the same reason
when project instance panel and project network panel are disabled.
All are because required templates exist in project panel.

It seems we need a way to use templates in project panel from admin panel even when project panel is disabled.
Some requirement declaration may be needed.

Another *adhoc* way seems to copy all required templates from project/ to admin/.

I don't have time to investigate it more deeply right now.
I remove me from the assignee.

Changed in horizon:
assignee: Akihiro Motoki (amotoki) → nobody
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-3 → juno-rc1
Changed in horizon:
assignee: nobody → Nikunj Aggarwal (nikunj2512)
David Lyle (david-lyle)
Changed in horizon:
milestone: juno-rc1 → kilo-1
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → kilo-2
Revision history for this message
Akihiro Motoki (amotoki) wrote :

IMHO the ideal way is to have a location which stores common templates
so that every panel can use templates as it wants even though some panel
is disabled. At the moment I don't have a good idea where is the best place.
It is just an idea.

David Lyle (david-lyle)
Changed in horizon:
milestone: kilo-2 → kilo-3
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → kilo-rc1
David Lyle (david-lyle)
Changed in horizon:
milestone: kilo-rc1 → liberty-1
tags: added: kilo-rc-potential
David Lyle (david-lyle)
tags: removed: kilo-rc-potential
Changed in horizon:
milestone: liberty-1 → liberty-2
Changed in horizon:
milestone: liberty-2 → liberty-3
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-3 → liberty-rc1
David Lyle (david-lyle)
Changed in horizon:
milestone: liberty-rc1 → next
Changed in horizon:
assignee: Nikunj Aggarwal (nikunj2512) → nobody
anusha (anusha)
Changed in horizon:
assignee: nobody → anusha (anusha)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/408583

Revision history for this message
anusha (anusha) wrote : Re: Networks panel can't be actually disabled

1.Disabling networks panel in Project,admin networks panel should work.
2.Maintained common templates used by both Project and Admin separately in the path
    horizon/openstack_dashboard/templates/networks/

Change-Id: If1750c35a63fe546436e1abe31f14ddc56c0fd1c
Closes-Bug: #1321865

https://review.openstack.org/#/c/408583/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/427114

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by anusha (<email address hidden>) on branch: master
Review: https://review.openstack.org/408583

Akihiro Motoki (amotoki)
Changed in horizon:
status: In Progress → Confirmed
assignee: anusha (anusha) → nobody
Revision history for this message
Akihiro Motoki (amotoki) wrote : Re: Networks panel can't be actually disabled

There seems two possible approaches.
(a) Move templates used in both the admin and project panels into some common place like openstack_dashboard/static/xxx. This solution might require us to move files a bit often.
(b) Declare dependencies on other templates and if declared the plugin framework add it to the template path. If the dependency is only from admin to project, this solution works.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

This is not specific to the network panel. The title should be updated.

summary: - Networks panel can't be actually disabled
+ Project panels (like Networks panel) can't be actually disabled
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Ivan Kolodyazhny (<email address hidden>) on branch: master
Review: https://review.openstack.org/427114
Reason: This review is > 4 months without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

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.