From: Salvatore Orlando Date: Fri, 4 Apr 2014 10:30:12 +0000 (-0700) Subject: Don't emit log for missing attribute check policy X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ef01fb553a141c012c8d8600edd6b709c5807111;p=openstack-build%2Fneutron-build.git 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 --- 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