From ca6ef9ef78318e7a469df6c748f6236e4f4e711d Mon Sep 17 00:00:00 2001 From: "wei.ying" Date: Wed, 23 Aug 2017 21:35:43 +0800 Subject: [PATCH] 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 --- openstack_dashboard/dashboards/project/networks/ports/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/networks/ports/views.py b/openstack_dashboard/dashboards/project/networks/ports/views.py index 603290f285..e89cf297de 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/views.py +++ b/openstack_dashboard/dashboards/project/networks/ports/views.py @@ -142,7 +142,8 @@ class DetailView(tabs.TabbedTableView): port.network_url = reverse(network_url, args=[port.network_id]) for ip in port.fixed_ips: ip['subnet_url'] = reverse(subnet_url, args=[ip['subnet_id']]) - port.security_groups = self.get_security_groups(port.security_groups) + port.security_groups = self.get_security_groups( + tuple(port.security_groups)) table = project_tables.PortsTable(self.request, network_id=port.network_id) # TODO(robcresswell) Add URL for "Ports" crumb after bug/1416838