memoized_with_request should return hashable types

Bug #1596545 reported by Yves-Gwenael Bourhis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Yves-Gwenael Bourhis

Bug Description

memoized_with_request functions should return hashable types, otherwise memoizing will not work
 because memoizing is based on the fact that function call arguments are hashable.

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

Changed in horizon:
assignee: nobody → Yves-Gwenael Bourhis (yves-gwenael-bourhis)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit eb3180f82710956713e659c73216012d558836b0
Author: Yves-Gwenael Bourhis <email address hidden>
Date: Mon Jun 27 15:55:05 2016 +0200

    Returning a tuple instead of list in list_extensions

    extension_supported is decorated with
    memoized_with_request(list_extensions, 1).
    This means that list_extensions is called to build the args for
    extension_supported and then make a hash.
    list_extensions was returning a list which is unhashable.
    We now return a tuple which has the following advantages:
    1: is hashable.
    2: tuples use less memory than lists in python, and should be use when we do
    not need a mutable.

    Change-Id: I92be6ef7880c6ac76847ec9cc8b2c83a6fd009b2
    Closes-Bug: #1596545

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b2

This issue was fixed in the openstack/horizon 10.0.0.0b2 development milestone.

Changed in horizon:
importance: Undecided → High
milestone: none → newton-2
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.