From bfffd1cec5c3195ac1759094635401eaabbfa8f4 Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Wed, 22 Jul 2015 18:33:19 -0400 Subject: Fixes EndpointNotFound after deployment After deploying an overcloud via the UI, the generic error page for Horizon is displayed. With debugging enabled, an EndpointNotFound error message is displayed. This is caused by the dashboard_urls method attempting to access a method on the overcloud keystone client before the overcloud keystone service is initialized. This patch wraps the code to check for initialized services in a try block and returns an empty list in the event an exception is thrown. Change-Id: I7da53ea085b2728950c3a0c2760d0745119e6ff1 Resolves: rhbz#1245192 --- tuskar_ui/api/heat.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tuskar_ui/api/heat.py b/tuskar_ui/api/heat.py index 9852ca00..923565ec 100644 --- a/tuskar_ui/api/heat.py +++ b/tuskar_ui/api/heat.py @@ -429,12 +429,14 @@ class Stack(base.APIResourceWrapper): if not client: return [] - services = client.services.list() - - for service in services: - if service.name == 'horizon': - break - else: + try: + services = client.services.list() + for service in services: + if service.name == 'horizon': + break + else: + return [] + except Exception: return [] admin_urls = [endpoint.adminurl for endpoint -- cgit v1.2.1