Relocating panel to a different dashboard via Pluggable Settings causes TemplateDoesNotExist

Bug #1533910 reported by Alan Fung
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
In Progress
Medium
Vishal Manchanda

Bug Description

Steps to reproduce:

1. Move users panel to be under admin dashboard by modifying _3030_identity_users_panel.py
2. Set PANEL_GROUP = 'admin'
3. Set PANEL_DASHBOARD = 'admin'

Expected:

1. Users panel to be under Admin panel group in the navigation.
2. Users panel to load.

Actual:

1. Users panel under Admin panel group in the navigation.
2. Users panel would generate a TemplateDoesNotExist

Observations:

This issue is due to Dashboard.register populates the panel_template_dirs for horizon template loader with the key "admin/users" for the Identity Users panel. However, TemplateLoader.get_template_sources would still look up "identity/users" for templates by convention (i.e. template "identity/users/index.html")..

Alan Fung (alanfung)
description: updated
Revision history for this message
Alan Fung (alanfung) wrote :

As a suggestion to address this, we can modify Dashboard.register to generate the key from panel_dir (directory of the panel) instead of appending cls.slug and panel.slug.

Both approaches to generate the key make assumptions about the file layout, but the suggested is less fallible and compatible with (what I presume) to be a function of Pluggable Settings, which is the flexibility of moving panel to any dashboard.

Changed in horizon:
status: New → Confirmed
importance: Undecided → High
milestone: none → next
Alan Fung (alanfung)
Changed in horizon:
assignee: nobody → Alan Fung (alanfung)
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/271201

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
ST9527 (st9527-cs229) wrote :

Even when you fixed it, find the template,it will still crash when a panel contains tables!

When I move 'project/instances' under 'identity',it reports error like this:

TemplateSyntaxError

u'instances' is not a registered namespace inside 'horizon:project'

Changed in horizon:
assignee: Alan Fung (alanfung) → Richard Jones (r1chardj0n3s)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Rob Cresswell (<email address hidden>) on branch: master
Review: https://review.openstack.org/271201
Reason: Abandoned due to inactivity. Please feel free to restore if you wish to work on it.

amber (amber1987)
description: updated
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Clearing the assignee due to long inactivity.

Changed in horizon:
assignee: Richard Jones (r1chardj0n3s) → nobody
Ivan Kolodyazhny (e0ne)
Changed in horizon:
status: In Progress → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/666805

Changed in horizon:
assignee: nobody → Vishal Manchanda (vishalmanchanda)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Vishal Manchanda (<email address hidden>) on branch: master
Review: https://review.opendev.org/666805
Reason: abandoning this patch and restore original patch https://review.opendev.org/#/c/271201/

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

Decresing the priority (as we don't work on this for long long long and it does not seem to be a high priority item.

Changed in horizon:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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