diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2014-04-08 13:34:20 +0200 |
---|---|---|
committer | Ana Krivokapic <akrivoka@redhat.com> | 2014-04-08 13:34:20 +0200 |
commit | 3d7dc492a76836248e5f4c771467267902fcef77 (patch) | |
tree | 7670245bd5582c035df23d23b0c914faf58f5f63 /tuskar_ui/infrastructure/overcloud/views.py | |
parent | 883068ac5be231bfa7c1c07435635f634dc77730 (diff) | |
download | tuskar-ui-3d7dc492a76836248e5f4c771467267902fcef77.tar.gz |
Fix error when viewing role with no flavor
If a role had no flavor associated with it, there was an error when
trying to access the role detail page. This fix ensures that the
text 'No flavor associated' is shown instead.
Change-Id: I6e13c062c3013cb98bf4a7d1d80bbeef9226a99e
Diffstat (limited to 'tuskar_ui/infrastructure/overcloud/views.py')
-rw-r--r-- | tuskar_ui/infrastructure/overcloud/views.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tuskar_ui/infrastructure/overcloud/views.py b/tuskar_ui/infrastructure/overcloud/views.py index 1ee0982e..72e44dd5 100644 --- a/tuskar_ui/infrastructure/overcloud/views.py +++ b/tuskar_ui/infrastructure/overcloud/views.py @@ -11,6 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +import novaclient from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ @@ -171,6 +172,8 @@ class OvercloudRoleView(horizon_tables.DataTableView, try: context['flavor'] = nova.flavor_get(self.request, role.flavor_id) + except novaclient.exceptions.NotFound: + context['flavor'] = None except Exception: msg = _('Unable to retrieve flavor.') horizon.exceptions.handle(self.request, msg) |