summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-09 18:31:27 +0000
committerGerrit Code Review <review@openstack.org>2016-11-09 18:31:27 +0000
commita9b6e8b8fa273d7233b0ef20bd199d05b9e1b4ce (patch)
treef1d35ede69ac87ebe4981b926e4c6368be32f553
parent4ed29c221b6e4a30220b46b2b7901dec6858de26 (diff)
parent8721106cfc809139cdfb51ed1414150506c0d54c (diff)
downloadoslo-policy-a9b6e8b8fa273d7233b0ef20bd199d05b9e1b4ce.tar.gz
Merge "Make exception PolicyNotAuthorized more readable"
-rw-r--r--oslo_policy/policy.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py
index 50f6a25..c1c3665 100644
--- a/oslo_policy/policy.py
+++ b/oslo_policy/policy.py
@@ -297,7 +297,8 @@ class PolicyNotAuthorized(Exception):
"""Default exception raised for policy enforcement failure."""
def __init__(self, rule, target, creds):
- msg = (_('%(rule)s on %(target)s by %(creds)s disallowed by policy') %
+ msg = (_('%(target)s is disallowed by policy rule %(rule)s '
+ 'with %(creds)s ') %
{'rule': rule, 'target': target, 'creds': creds})
super(PolicyNotAuthorized, self).__init__(msg)