Cleanup logging to conform to guidelines

Syncing change from oslo-incubator change id:
I7decb7bf5f3185f7d26ad99b0cb3475a88d3ec99

Change-Id: Ib03a947cce5b68d4693c93d740ffa1adecf61c46
This commit is contained in:
ShaoHe Feng 2015-05-21 02:56:56 +08:00
parent 1e7b5974f0
commit c586daebed
2 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ def _parse_check(rule):
try:
kind, match = rule.split(':', 1)
except Exception:
LOG.exception(_LE('Failed to understand rule %s') % rule)
LOG.exception(_LE('Failed to understand rule %s'), rule)
# If the rule is invalid, we'll fail closed
return _checks.FalseCheck()
@ -209,7 +209,7 @@ def _parse_check(rule):
elif None in _checks.registered_checks:
return _checks.registered_checks[None](kind, match)
else:
LOG.error(_LE('No handler for matches of kind %s') % kind)
LOG.error(_LE('No handler for matches of kind %s'), kind)
return _checks.FalseCheck()
@ -325,7 +325,7 @@ def _parse_text_rule(rule):
return state.result
except ValueError:
# Couldn't parse the rule
LOG.exception(_LE('Failed to understand rule %s') % rule)
LOG.exception(_LE('Failed to understand rule %s'), rule)
# Fail closed
return _checks.FalseCheck()

View File

@ -481,7 +481,7 @@ class Enforcer(object):
# Evaluate the rule
result = self.rules[rule](target, creds, self)
except KeyError:
LOG.debug('Rule [%s] does not exist' % rule)
LOG.debug('Rule [%s] does not exist', rule)
# If the rule doesn't exist, fail closed
result = False