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
This commit is contained in:
Salvatore Orlando 2014-04-04 03:30:12 -07:00
parent f8ee7b0f3c
commit ef01fb553a
1 changed files with 4 additions and 4 deletions

View File

@ -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