Clean some log messages when polling neutron resources
- Handle the regular resource not found warnings when polling neutron resources - Set the default log level of neutronclient to INFO to avoid recording requests of neutronclient token issuing. Change-Id: I94836b3031bae5bee2634b301c67a0c9487112ac Closes-Bug: #1504396
This commit is contained in:
parent
6fe1319f66
commit
213b585ced
@ -39,12 +39,11 @@ def logged(func):
|
||||
def with_logging(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except exceptions.NotFound:
|
||||
# handles 404's when services are disabled in neutron
|
||||
LOG.warn("The resource could not be found.")
|
||||
return []
|
||||
except exceptions.NeutronClientException as e:
|
||||
LOG.warn(e)
|
||||
if e.status_code == 404:
|
||||
LOG.warn("The resource could not be found.")
|
||||
else:
|
||||
LOG.warn(e)
|
||||
return []
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
|
@ -116,7 +116,8 @@ def prepare_service(argv=None, config_files=None):
|
||||
oslo_i18n.enable_lazy()
|
||||
log.register_options(cfg.CONF)
|
||||
log_levels = (cfg.CONF.default_log_levels +
|
||||
['stevedore=INFO', 'keystoneclient=INFO'])
|
||||
['stevedore=INFO', 'keystoneclient=INFO',
|
||||
'neutronclient=INFO'])
|
||||
log.set_defaults(default_log_levels=log_levels)
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
Loading…
Reference in New Issue
Block a user