From 4cbf3153e840315daae698037ec9c6a785d4e5d8 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Tue, 19 Sep 2017 12:18:48 -0700 Subject: [PATCH] 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 f8fb73aa30f075712b5ca18c78b88d6ae9e60566) --- neutron/pecan_wsgi/hooks/notifier.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/pecan_wsgi/hooks/notifier.py b/neutron/pecan_wsgi/hooks/notifier.py index 84a3ac5d4d7..cc32adedfaf 100644 --- a/neutron/pecan_wsgi/hooks/notifier.py +++ b/neutron/pecan_wsgi/hooks/notifier.py @@ -65,15 +65,15 @@ class NotifierHook(hooks.PecanHook): resource_name = state.request.context.get('resource') collection_name = state.request.context.get('collection') 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) if not action or action not in ('create', 'update', 'delete'): return if utils.is_member_action(utils.get_controller(state)): 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: LOG.debug("No notification will be sent due to unsuccessful " "status code: %s", state.response.status_int)