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
This commit is contained in:
parent
8b61fdd2db
commit
b65554eb46
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user