Dont log about skipping notification in normal case
Avoid logging about a missing resource for normal cases
where there is no resource in the request (e.g. HTTP GET's,
custom actions, etc).
Change-Id: I04c6b6737f238ca6250869b92e1d0771b4f95f22
Partial-Bug: #1707307
(cherry picked from commit f8fb73aa30
)
This commit is contained in:
parent
5b0191f524
commit
4cbf3153e8
@ -65,15 +65,15 @@ class NotifierHook(hooks.PecanHook):
|
|||||||
resource_name = state.request.context.get('resource')
|
resource_name = state.request.context.get('resource')
|
||||||
collection_name = state.request.context.get('collection')
|
collection_name = state.request.context.get('collection')
|
||||||
neutron_context = state.request.context.get('neutron_context')
|
neutron_context = state.request.context.get('neutron_context')
|
||||||
if not resource_name:
|
|
||||||
LOG.debug("Skipping NotifierHook processing as there was no "
|
|
||||||
"resource associated with the request")
|
|
||||||
return
|
|
||||||
action = pecan_constants.ACTION_MAP.get(state.request.method)
|
action = pecan_constants.ACTION_MAP.get(state.request.method)
|
||||||
if not action or action not in ('create', 'update', 'delete'):
|
if not action or action not in ('create', 'update', 'delete'):
|
||||||
return
|
return
|
||||||
if utils.is_member_action(utils.get_controller(state)):
|
if utils.is_member_action(utils.get_controller(state)):
|
||||||
return
|
return
|
||||||
|
if not resource_name:
|
||||||
|
LOG.debug("Skipping NotifierHook processing as there was no "
|
||||||
|
"resource associated with the request")
|
||||||
|
return
|
||||||
if state.response.status_int > 300:
|
if state.response.status_int > 300:
|
||||||
LOG.debug("No notification will be sent due to unsuccessful "
|
LOG.debug("No notification will be sent due to unsuccessful "
|
||||||
"status code: %s", state.response.status_int)
|
"status code: %s", state.response.status_int)
|
||||||
|
Loading…
Reference in New Issue
Block a user