summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPradeep Kilambi <pkilambi@cisco.com>2014-09-30 11:24:20 -0700
committerEoghan Glynn <eglynn@redhat.com>2014-10-07 13:07:19 +0100
commitaa15b2d7ed02822b72f878e889b3a77c97b4a6c5 (patch)
tree5067d0fc81dad2211336f05f4b9143665d62a696
parent8b61fdd2db831dcb651c42c9bcdafc1c8aa37451 (diff)
downloadceilometer-aa15b2d7ed02822b72f878e889b3a77c97b4a6c5.tar.gz
Fix neutron client to catch 404 exceptions
When network services such as lbaas, fwaas or vpnaas are disabled in neutron, the discovery continues to poll the api calls and gets back a not found exception. The fix here is to catch the exception so it doesn't go unhandled. Change-Id: I8f350b9009f0d8c172836b1dd1123e966f887fdb Closes-Bug: #1374012 (cherry picked from commit b65554eb460a282a2ab0a2dcc0053a8691cb9373)
-rw-r--r--ceilometer/neutron_client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ceilometer/neutron_client.py b/ceilometer/neutron_client.py
index 930d7eab..c9751cf1 100644
--- a/ceilometer/neutron_client.py
+++ b/ceilometer/neutron_client.py
@@ -16,6 +16,7 @@
import functools
+from neutronclient.common import exceptions
from neutronclient.v2_0 import client as clientv20
from oslo.config import cfg
@@ -40,6 +41,10 @@ def logged(func):
def with_logging(*args, **kwargs):
try:
return func(*args, **kwargs)
+ except exceptions.NeutronClientException as e:
+ # handles 404's when services are disabled in neutron
+ LOG.warn(e)
+ return []
except Exception as e:
LOG.exception(e)
raise