← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1712582] Re: Unable to use @memoized cache when call get_security_groups

 

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 <wei.ying@xxxxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1712582

Title:
  Unable to use @memoized cache when call get_security_groups

Status in OpenStack Dashboard (Horizon):
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1712582/+subscriptions


References