Browse Source

Handle the exception if _extra_data(instance) is called on a missing instance

Closes-Bug: #1926928
Change-Id: Ib782ff21770978ef09eb8b44abe115b730f7e7f9
changes/10/789110/2
Andrew Bogott 1 week ago
parent
commit
d18e3e8f17
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      trove_dashboard/content/databases/views.py

+ 9
- 1
trove_dashboard/content/databases/views.py View File

@ -79,7 +79,15 @@ class IndexView(horizon_tables.DataTableView):
msg = _('Unable to retrieve database instances.')
exceptions.handle(self.request, msg)
for instance in instances:
self._extra_data(instance)
# The instance might have gotten deleted since we last collected
# our instance list. Try to be a bit graceful if it's gone.
try:
self._extra_data(instance)
except Exception:
msg = _('Unable to retrieve details for instance %s' %
instance.id)
redirect = reverse('horizon:project:databases:index')
exceptions.handle(self.request, msg, redirect=redirect)
return instances


Loading…
Cancel
Save