Improved keystone error handling in syspanel.

* Added "AuthorizationFailure" to the recoverable errors list
    since keystoneclient raises it anytime it can't talk to
    keystone. Fixes bug 971249.

  * Used proper exception handling for the users index view.
    Fixed some tests that had been failiing but masked previously.
    Fixes bug 971250.

Change-Id: Iec8c1fc7bf8585a529fa15af55f807abc0f84d42
This commit is contained in:
Gabriel Hurley
2012-04-02 00:15:36 -07:00
parent 0bf1e5e953
commit 289fc72168
4 changed files with 26 additions and 25 deletions

View File

@@ -45,7 +45,8 @@ class IndexView(tables.DataTableView):
try:
tenants = api.keystone.tenant_list(self.request, admin=True)
except:
exceptions.handle(self.request)
exceptions.handle(self.request,
_("Unable to retrieve project list."))
tenants.sort(key=lambda x: x.id, reverse=True)
return tenants
@@ -67,7 +68,7 @@ class UpdateView(forms.ModalFormView):
except:
redirect = reverse("horizon:syspanel:projects:index")
exceptions.handle(self.request,
_('Unable to retrieve tenant.'),
_('Unable to retrieve project.'),
redirect=redirect)
def get_initial(self):