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
This commit is contained in:
Andrew Lazarev 2014-11-25 16:13:35 -08:00 committed by David Lyle
parent fd6e194463
commit 51024cc13b
1 changed files with 9 additions and 5 deletions

View File

@ -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):