From 58762cda5a7b0b11058b15bfd41108ddcfdc3c34 Mon Sep 17 00:00:00 2001 From: Tihomir Trifonov Date: Tue, 5 Jun 2012 18:11:01 +0300 Subject: [PATCH] Added a check for attachment['instance'] The problem, described in the ticket occurs while you try to attach a volume to instance, while at the same time terminating the instance( I've succeeded to reproduce it that way). As seen from the stack trace - the error comes after an AJAX call for updating the table rows. In normal situations with loading the page, this error should not appear. Anyway, now there is a check to prevent this error. Fixes bug 999502 Change-Id: Ifccc2cf724fe14098c74b55e65f8fbdd8c5434dc --- .../dashboards/nova/instances_and_volumes/volumes/tables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py b/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py index 38a3a0167..57d9b270f 100644 --- a/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py +++ b/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py @@ -93,7 +93,8 @@ def get_attachment(volume): args=(attachment["server_id"],)) # TODO(jake): Make "instance" the instance name vals = {"url": url, - "name": attachment["instance"].name, + "name": attachment["instance"].name + if "instance" in attachment else None, "instance": attachment["server_id"], "dev": attachment["device"]} attachments.append(link % vals)