Unable to use @memoized cache when call get_security_groups

Bug #1712582 reported by wei.ying
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
wei.ying

Bug Description

Env: devstack master branch

Description:

The memoized function needs to use tuples as parameters [1].

Currently [2] the security_groups attribute in the port object, whose type is list,
when clicking the port details, a warning message appears:
"UnhashableKeyWarning: The key ((<weakref at 0x7ff5da258520; to 'DetailView' at 0x7ff5da275790>, []), ()) is not hashable and cannot be memoized.
WARNING:py.warnings:UnhashableKeyWarning: The key ((<weakref at 0x7ff5da258520; to 'DetailView' at 0x7ff5da275790>, []), ()) is not hashable and cannot be memoized."

[1] https://github.com/openstack/horizon/blob/4570b4cd7813c5b5d559a87c715f4ee6e6f1f63d/horizon/utils/memoized.py#L39
[2] https://github.com/openstack/horizon/blob/609bf8fbc98c0dc437b4522d27a9ad4e3ba6fd30/openstack_dashboard/dashboards/project/networks/ports/views.py#L145

wei.ying (wei.yy)
Changed in horizon:
assignee: nobody → wei.ying (wei.yy)
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/496711

Changed in horizon:
status: New → In Progress
yongxiangwang (wangyxv)
information type: Public → Public Security
information type: Public Security → Public
Changed in horizon:
importance: Undecided → Medium
Akihiro Motoki (amotoki)
summary: - Unable to use use @memoized cache when call get_security_groups
+ Unable to use @memoized cache when call get_security_groups
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit ca6ef9ef78318e7a469df6c748f6236e4f4e711d
Author: wei.ying <email address hidden>
Date: Wed Aug 23 21:35:43 2017 +0800

    Fix UnhashableKeyWarning when calling get_security_groups function

    Memoized caches function specifies use tuples as parameters because
    lists are not hashable. When the get_security_groups function is called,
    the list type parameter is passed in, this causing fail to use memoized
    and the console appears UnhashableKeyWarning.

    Change-Id: Idc1262c714c3a6a451753286d6b414a27f6cb2cc
    Closes-Bug:#1712582

Changed in horizon:
status: In Progress → Fix Released
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → queens-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b2

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

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.