From 3940b430f1e72b70a758d348fb5447f0fb0aa17f Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Fri, 4 Apr 2014 03:30:12 -0700 Subject: [PATCH] Don't emit log for missing attribute check policy A missing policy for validating whether an attribute should be visible or not is a perfectly normal condition, and there is no value in logging it. Writing this information to the log is also having a considerable performance impact on list operations. Change-Id: Ie9d3ae6b249a5c49f6d81c1e56915174d8479a07 Closes-Bug: 1302467 (cherry picked from commit ef01fb553a141c012c8d8600edd6b709c5807111) --- neutron/api/v2/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/api/v2/base.py b/neutron/api/v2/base.py index bfd6dcf9d..b1df7e0e2 100644 --- a/neutron/api/v2/base.py +++ b/neutron/api/v2/base.py @@ -146,10 +146,10 @@ class Controller(object): {'resource': self._collection, 'attr': attr_name}) except exceptions.PolicyRuleNotFound: - LOG.debug(_("Policy rule:%(action)s not found. Assuming no " - "authZ check is defined for %(attr)s"), - {'action': action, - 'attr': attr_name}) + # Just ignore the exception. Do not even log it, as this will add + # a lot of unnecessary info in the log (and take time as well to + # write info to the logger) + pass attr_val = self._attr_info.get(attr_name) return attr_val and attr_val['is_visible'] and authz_check -- 2.45.2