Prevent UnboudLocalError when checking out tenants for packages

Before an UnboudLocalError would be thrown in case keystone returned an
error, when asking for tenant list on 'Package Definitions' tab.
This patch initialises the variable, to prevent such errors.

Change-Id: I2ee359959907a4d67baa26fbc37d71f6477dfb35
Related-Bug: 1496418
This commit is contained in:
Kirill Zaitsev 2015-09-17 18:09:23 +03:00
parent feeb14f8b8
commit 071c61f3b2
1 changed files with 1 additions and 0 deletions

View File

@ -123,6 +123,7 @@ class PackageDefinitionsView(horizon_tables.DataTableView):
# Add information about project tenant for admin user
if self.request.user.is_superuser:
tenants = []
try:
tenants, _more = keystone.tenant_list(self.request)
except Exception: