summaryrefslogtreecommitdiffstats
path: root/keystone
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-14 01:28:55 +0000
committerGerrit Code Review <review@openstack.org>2013-05-14 01:28:55 +0000
commitcb0ddabff3609e408ef30ccb55842cb4e724e329 (patch)
treea5d8cf05692aa8bb924878dd1c74e73288c5fad5 /keystone
parentefc30beab10faf4720a96322adb135726662b025 (diff)
parentd1da173017216a4506d93203a3c1c2fb6bba96b8 (diff)
Merge "Enable unicode error message"
Diffstat (limited to 'keystone')
-rw-r--r--keystone/exception.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/keystone/exception.py b/keystone/exception.py
index eaacfcf0..21844300 100644
--- a/keystone/exception.py
+++ b/keystone/exception.py
@@ -56,14 +56,10 @@ class Error(StandardError):
:raises: KeyError given insufficient kwargs
"""
- return message or self.__doc__ % kwargs
-
- def __str__(self):
- """Cleans up line breaks and indentation from doc strings."""
- string = super(Error, self).__str__()
- string = re.sub('[ \n]+', ' ', string)
- string = string.strip()
- return string
+ if not message:
+ message = re.sub('[ \n]+', ' ', self.__doc__ % kwargs)
+ message = message.strip()
+ return message
class ValidationError(Error):