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
This commit is contained in:
Cindy Lu 2015-09-29 12:08:28 -07:00
parent a2c1e79cde
commit 49fad8b093
2 changed files with 4 additions and 3 deletions

View File

@ -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, {})

View File

@ -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,