Registering 2 Dashboards breaks get_dashboards

Bug #1836295 reported by Stephen Crawley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Akihiro Motoki

Bug Description

When 2 or more Dashboards are registered manually, the get_dashboards() method breaks saying that '<' is not supported between the dashboard classes. The problem is that the get_dashboards() method attempts to order the manually registered dashboards (alphabetically according to the docs) by Dashboard doesn't define a natural ordering.

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

Changed in horizon:
assignee: nobody → Stephen Crawley (s-crawley)
status: New → In Progress
description: updated
Revision history for this message
Stephen Crawley (s-crawley) wrote :

Apparently, this bug does not manifest in python 2.7.

Changed in horizon:
assignee: Stephen Crawley (s-crawley) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/670446
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a95398d012ffdd82e7d4a5e591dfd88e68f44f24
Submitter: Zuul
Branch: master

commit a95398d012ffdd82e7d4a5e591dfd88e68f44f24
Author: Stephen Crawley <email address hidden>
Date: Thu Jul 11 10:17:24 2019 +1000

    Manually registering 2 Dashboards breaks get_dashboards() (python3)

    The get_dashboards() method used sorted(<values>) to sort the
    dashboards that have been registered manually. This breaks if
    two or more are registered that way because the Dashboard class
    doesn't define a natural ordering. The fix is to sort using
    the Dashboard name as the sort key. (Unit test included.)

    This problem doesn't occur in python 2.7.

    P.S.
    It turns out that AdminPanel in horizon/test/unit/test_base.py is not
    used during the review. It is dropped too as it is a simple change.

    Change-Id: I6be10a92a1f43b3e0effee8148987c7e2c5690ff
    Closes-bug: #1836295

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 18.1.0

This issue was fixed in the openstack/horizon 18.1.0 release.

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.