Plugin panel not listed in configured panel group

Bug #1378558 reported by Janet Yu
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Janet Yu
Juno
Fix Released
High
Thomas Bechtold
Kilo
Fix Released
High
David Lyle

Bug Description

When adding panel Foo to the Admin dashboard's System panel group via the openstack_dashboard/local/enabled/ directory, with something like:

PANEL = 'foo'
PANEL_DASHBOARD = 'admin'
PANEL_GROUP = 'admin'
ADD_PANEL = 'openstack_dashboard.dashboards.admin.foo.panel.Foo'

Foo appears under the panel group Other instead of System. This is the error in the Apache log:

Could not process panel foo: 'tuple' object has no attribute 'append'

Janet Yu (jwy)
Changed in horizon:
assignee: nobody → Janet Yu (jwy)
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/128133

Changed in horizon:
status: New → In Progress
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

While bug 1403094 is almost the same one as this one, it revealed another possible problem in the code being fixed. Please, see my comments in gerrit.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Hello, Janet! How is your progress on this issue?

Revision history for this message
Janet Yu (jwy) wrote :

Hey Timur, I've added the unit test and related test fixes for custom panels. Thanks for your explanation of bug 1403094. I can reproduce it and will be revising my original patch this week. Been working on another panels issue, bug 1408513.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Okay, thanks for the update :)!

Changed in horizon:
importance: Undecided → Medium
Revision history for this message
reachlin (reachlin) wrote :

pls merge this ASAP.

Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

Changing priority to high since it prevents plugins from working.

Changed in horizon:
importance: Medium → High
David Lyle (david-lyle)
tags: added: kilo-rc-potential
Changed in horizon:
assignee: Janet Yu (jwy) → Lin Hua Cheng (lin-hua-cheng)
Changed in horizon:
assignee: Lin Hua Cheng (lin-hua-cheng) → Janet Yu (jwy)
milestone: none → liberty-1
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/128133
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=e2ef492311a427fe3b5b41a6df6bd9be5a22c174
Submitter: Jenkins
Branch: master

commit e2ef492311a427fe3b5b41a6df6bd9be5a22c174
Author: Janet Yu <email address hidden>
Date: Fri Mar 13 13:50:42 2015 -0700

    Fix addition of plugin panel to panel group

    Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
    class. Adding a plugin panel to a dashboard whose class has its panels defined
    in a tuple will fail because the new plugin cannot be appended to the tuple.
    The code errors out before the panel gets added to the dashboard's panel list.
    However, at this point, the panel has already been registered with the
    dashboard. This causes Dashboard.get_panels() to see the panel in its registry
    but not in its panel groups. Consequently, the panel gets put in the "Other"
    panel group instead of its configured one, as described in bug #1378558.

    By not adding the the plugin panel to its dashboard's class, the panel gets
    added to its dashboard's panel list. Now the original issue from bug #1329050
    resurfaces. The root cause of that is that every time Dashboard._autodiscover()
    is called, it instantiates all its panel group classes, wiping out any panels
    previously added to any of the panel groups. Avoid this by always processing
    all the plugin panel groups before any of the plugin panels, which also ensures
    that the panel groups exist before their panels.

    Making this change exposed an issue where the Horizon URLs were being loaded
    twice during the plugin infrastructure's unit tests, causing plugin panels to
    be added multiple times to their dashboards. Fix that by removing the second,
    unnecessary call. Also create a second test plugin panel group and panel to
    test the scenarios described in the two bugs addressed here, adding two panel
    groups at a time.

    Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
    Closes-Bug: 1378558

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/176856

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/kilo)

Reviewed: https://review.openstack.org/176856
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=5c1604275bfbe621e5e168f8ba1f937d308d6ab8
Submitter: Jenkins
Branch: stable/kilo

commit 5c1604275bfbe621e5e168f8ba1f937d308d6ab8
Author: Janet Yu <email address hidden>
Date: Fri Mar 13 13:50:42 2015 -0700

    Fix addition of plugin panel to panel group

    Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
    class. Adding a plugin panel to a dashboard whose class has its panels defined
    in a tuple will fail because the new plugin cannot be appended to the tuple.
    The code errors out before the panel gets added to the dashboard's panel list.
    However, at this point, the panel has already been registered with the
    dashboard. This causes Dashboard.get_panels() to see the panel in its registry
    but not in its panel groups. Consequently, the panel gets put in the "Other"
    panel group instead of its configured one, as described in bug #1378558.

    By not adding the the plugin panel to its dashboard's class, the panel gets
    added to its dashboard's panel list. Now the original issue from bug #1329050
    resurfaces. The root cause of that is that every time Dashboard._autodiscover()
    is called, it instantiates all its panel group classes, wiping out any panels
    previously added to any of the panel groups. Avoid this by always processing
    all the plugin panel groups before any of the plugin panels, which also ensures
    that the panel groups exist before their panels.

    Making this change exposed an issue where the Horizon URLs were being loaded
    twice during the plugin infrastructure's unit tests, causing plugin panels to
    be added multiple times to their dashboards. Fix that by removing the second,
    unnecessary call. Also create a second test plugin panel group and panel to
    test the scenarios described in the two bugs addressed here, adding two panel
    groups at a time.

    Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
    Closes-Bug: 1378558
    (cherry picked from commit e2ef492311a427fe3b5b41a6df6bd9be5a22c174)

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/179289

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)
Download full text (6.3 KiB)

Reviewed: https://review.openstack.org/179289
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=aba74d04a530fb6c251c15037da96b7a93b83a7e
Submitter: Jenkins
Branch: master

commit 56d5683c8c49558ae22200bc01ec87ea83144003
Author: Akihiro Motoki <email address hidden>
Date: Thu Apr 23 06:58:49 2015 +0900

    Import translations from Transifex for Juno

    * Import ~100% completed translations
      (translations available for 12 languages)
    * Delete incomplete languages
    * Update language list in openstack_dashboard settings.py

    Change-Id: Ie65227e510d95504ed94fb35f0f7273739759601

commit 89d9f46750a7506d6910ae792c14ad47feaf53c3
Author: Doug Fish <email address hidden>
Date: Tue Apr 14 15:05:41 2015 -0500

    Format numbers in a locale sensitive manner

    Create Volume, Create Snapshot, Extend Volume and
    Flavors and Quota all fail to format numbers in a
    locale sensitive manner. This patch changes the code to
    use the intcomma filter before quota, instead of after. Once
    quota has added text the number can no longer be formatted.

    (Pulled from gate, can't pass checks)

    Change-Id: Id9749d9b25d93185b917708b85471e6f765033e2
    Closes-Bug: 1314801
    (cherry picked from commit 0872b4a40334a6df863f88e5aa56b31363aff28e)

commit a1ac5936211cc134a6fd5246007889a5149a18dd
Author: Akihiro Motoki <email address hidden>
Date: Sat Apr 18 19:53:06 2015 +0900

    update .tx/config to match Kilo Transifex resources

    (Pulled from gate, can't pass checks)

    Change-Id: I167d7787d3096c35a9ad73634e69058306731e44

commit 2e1216136a93a1c2129d9de05fcbbd032fae76e2
Author: OpenStack Proposal Bot <email address hidden>
Date: Thu Apr 23 15:48:09 2015 +0000

    Updated from global requirements

    Change-Id: I5602a6489684db95934130f3ce83c8eb37af2d3d

commit 624a85c7eee4e4fb4f88ccc8bd52caa6c0423e89
Author: lin-hua-cheng <email address hidden>
Date: Wed Apr 22 14:45:26 2015 -0700

    Initialize variable 'networks' before referencing

    Fixes the possible UnboundLocalError on the utility class.

    Change-Id: I52d27f90a583f1216a927147d1bd414c5f866608
    Closes-Bug: #1444421
    (cherry picked from commit 2e4996d2d220df0ae36a863fe694706e6f7aeb40)

commit 5c1604275bfbe621e5e168f8ba1f937d308d6ab8
Author: Janet Yu <email address hidden>
Date: Fri Mar 13 13:50:42 2015 -0700

    Fix addition of plugin panel to panel group

    Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
    class. Adding a plugin panel to a dashboard whose class has its panels defined
    in a tuple will fail because the new plugin cannot be appended to the tuple.
    The code errors out before the panel gets added to the dashboard's panel list.
    However, at this point, the panel has already been registered with the
    dashboard. This causes Dashboard.get_panels() to see the panel in its registry
    but not in its panel groups. Consequently, the panel gets put in the "Other"
    panel group instead of its configured one, as described in bug #1378558.

    By not adding the the plugin panel to its dashboard's class, the panel gets
    a...

Read more...

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/192215

Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/juno)

Reviewed: https://review.openstack.org/192215
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6b9f019959e47221291ca1f4723f389e6c6cda93
Submitter: Jenkins
Branch: stable/juno

commit 6b9f019959e47221291ca1f4723f389e6c6cda93
Author: Janet Yu <email address hidden>
Date: Fri Mar 13 13:50:42 2015 -0700

    Fix addition of plugin panel to panel group

    Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
    class. Adding a plugin panel to a dashboard whose class has its panels defined
    in a tuple will fail because the new plugin cannot be appended to the tuple.
    The code errors out before the panel gets added to the dashboard's panel list.
    However, at this point, the panel has already been registered with the
    dashboard. This causes Dashboard.get_panels() to see the panel in its registry
    but not in its panel groups. Consequently, the panel gets put in the "Other"
    panel group instead of its configured one, as described in bug #1378558.

    By not adding the the plugin panel to its dashboard's class, the panel gets
    added to its dashboard's panel list. Now the original issue from bug #1329050
    resurfaces. The root cause of that is that every time Dashboard._autodiscover()
    is called, it instantiates all its panel group classes, wiping out any panels
    previously added to any of the panel groups. Avoid this by always processing
    all the plugin panel groups before any of the plugin panels, which also ensures
    that the panel groups exist before their panels.

    Making this change exposed an issue where the Horizon URLs were being loaded
    twice during the plugin infrastructure's unit tests, causing plugin panels to
    be added multiple times to their dashboards. Fix that by removing the second,
    unnecessary call. Also create a second test plugin panel group and panel to
    test the scenarios described in the two bugs addressed here, adding two panel
    groups at a time.

    Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
    Closes-Bug: 1378558
    (cherry picked from commit e2ef492311a427fe3b5b41a6df6bd9be5a22c174)
    (cherry picked from commit 5c1604275bfbe621e5e168f8ba1f937d308d6ab8)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-1 → 8.0.0
Alan Pevec (apevec)
tags: removed: in-stable-juno
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.