Fix server get exception when deleting

Change-Id: I1b0eb3edca0a14288e0db5263daf898125908683
This commit is contained in:
Zhenguo Niu 2017-05-08 15:41:04 +08:00
parent 7e7fe5ccde
commit 1f892d2c0d
1 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from mogan_ui.api import mogan
from mogan_ui import exceptions
from horizon import tables
from horizon.utils import filters
@ -62,8 +63,11 @@ class UpdateRow(tables.Row):
ajax = True
def get_data(self, request, server_id):
server = mogan.server_get(request, server_id)
return server
try:
server = mogan.server_get(request, server_id)
return server
except exceptions.ResourceNotFound:
raise exceptions.NOT_FOUND
STATUS_DISPLAY_CHOICES = (