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']]