From 51024cc13b7bd2860432f3b517b27ff51e625578 Mon Sep 17 00:00:00 2001 From: Andrew Lazarev Date: Tue, 25 Nov 2014 16:13:35 -0800 Subject: [PATCH] Fixed row deletion for deleted stack Now heat returns stack with "stack_status == 'DELETE_COMPLETE'" for deleted stack. Added corresponding check to ajax handler. HTTPNotFound is not used anymore and deprecated. Removed except block for it. Added raise to generic "except Exception" block to prevent internal errors inside horizon. Change-Id: Ia9cfd975790872918ba25c347319003ddc3468fa Closes-Bug: #1367758 --- .../dashboards/project/stacks/tables.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/openstack_dashboard/dashboards/project/stacks/tables.py b/openstack_dashboard/dashboards/project/stacks/tables.py index eb0c7908bb..ef4ce40cd1 100644 --- a/openstack_dashboard/dashboards/project/stacks/tables.py +++ b/openstack_dashboard/dashboards/project/stacks/tables.py @@ -83,13 +83,17 @@ class StacksUpdateRow(tables.Row): def get_data(self, request, stack_id): try: - return api.heat.stack_get(request, stack_id) - except exc.HTTPNotFound: - # returning 404 to the ajax call removes the - # row from the table on the ui - raise Http404 + stack = api.heat.stack_get(request, stack_id) + if stack.stack_status == 'DELETE_COMPLETE': + # returning 404 to the ajax call removes the + # row from the table on the ui + raise Http404 + return stack + except Http404: + raise except Exception as e: messages.error(request, e) + raise class StacksTable(tables.DataTable):