From 49fad8b09341449c40f49826362242099558b23f Mon Sep 17 00:00:00 2001 From: Cindy Lu Date: Tue, 29 Sep 2015 12:08:28 -0700 Subject: [PATCH] Heat Stacks Details: Events table doesn't show up It shows a loading sign. There is an AttributeError because event_list does not return with any 'resource_type' to map. Since it doesn't make any sense, removed the resource_to_url link, and also add a check in the method. Change-Id: Ic94cffaa2450bbee3f9c9dabcaffb03a6cdc3b46 Closes-Bug: #1493216 --- openstack_dashboard/dashboards/project/stacks/mappings.py | 4 +++- openstack_dashboard/dashboards/project/stacks/tables.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openstack_dashboard/dashboards/project/stacks/mappings.py b/openstack_dashboard/dashboards/project/stacks/mappings.py index d5963eef85..145e41e5f3 100644 --- a/openstack_dashboard/dashboards/project/stacks/mappings.py +++ b/openstack_dashboard/dashboards/project/stacks/mappings.py @@ -116,7 +116,9 @@ resource_urls = { def resource_to_url(resource): - if not resource or not resource.physical_resource_id: + if (not resource or + not resource.physical_resource_id or + not hasattr(resource, 'resource_type')): return None mapping = resource_urls.get(resource.resource_type, {}) diff --git a/openstack_dashboard/dashboards/project/stacks/tables.py b/openstack_dashboard/dashboards/project/stacks/tables.py index afb78b05a7..324b4c2ebc 100644 --- a/openstack_dashboard/dashboards/project/stacks/tables.py +++ b/openstack_dashboard/dashboards/project/stacks/tables.py @@ -313,8 +313,7 @@ class EventsTable(tables.DataTable): verbose_name=_("Stack Resource"), link=get_resource_url) physical_resource = tables.Column('physical_resource_id', - verbose_name=_("Resource"), - link=mappings.resource_to_url) + verbose_name=_("Resource")) timestamp = tables.Column('event_time', verbose_name=_("Time Since Event"), filters=(filters.parse_isotime,