19168609 System Info page doesn't work properly
authorGirish Moodalbail <Girish.Moodalbail@oracle.COM>
Tue, 08 Jul 2014 21:43:41 -0700
changeset 1994 5e5f9e750e52
parent 1993 bd2585e291da
child 1995 7185ffa18a9e
19168609 System Info page doesn't work properly
components/openstack/horizon/patches/10-network-agents.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/horizon/patches/10-network-agents.patch	Tue Jul 08 21:43:41 2014 -0700
@@ -0,0 +1,27 @@
+In-house patch to handle Resource Not Found exception while trying
+to display the Network Agents panel. This is needed as our Neutron
+doesn't support Agents extension.
+
+--- horizon-2013.2.3/openstack_dashboard/api/neutron.py	2014-04-03 11:45:53.000000000 -0700
++++ NEW/openstack_dashboard/api/neutron.py	2014-07-08 09:35:42.219185826 -0700
+@@ -33,6 +33,7 @@
+ from openstack_dashboard.api import network_base
+ from openstack_dashboard.api import nova
+ 
++from neutronclient.common.exceptions import NeutronClientException
+ from neutronclient.v2_0 import client as neutron_client
+ 
+ LOG = logging.getLogger(__name__)
+@@ -718,7 +719,11 @@
+ 
+ 
+ def agent_list(request):
+-    agents = neutronclient(request).list_agents()
++    try:
++        agents = neutronclient(request).list_agents()
++    except NeutronClientException as nce:
++        if nce.status_code == 404:
++            return []
+     return [Agent(a) for a in agents['agents']]
+ 
+