summaryrefslogtreecommitdiff
path: root/heatclient/exc.py
diff options
context:
space:
mode:
authorBo Wang <bo.wang@easystack.cn>2016-02-16 20:44:57 +0800
committerBo Wang <bo.wang@easystack.cn>2016-02-16 20:44:57 +0800
commit236ba5fa6565fe340a1e098bcbe9b216fb5b8931 (patch)
tree030b15f63e0d92e0565533a9d2f2be8412415bd0 /heatclient/exc.py
parent7ee16eed9f251034c0da7a58b1b0f3f6c9f0d220 (diff)
downloadpython-heatclient-236ba5fa6565fe340a1e098bcbe9b216fb5b8931.tar.gz
Use oslo.utils.reflection to extract class name
The oslo.utils.reflection.get_class_name() handles more variations of where a class name may come from (on) python 2 and python 3. Its usage allows getting more accurate class names so we'd better use it. Change-Id: I97cc7f1e818161c2fe265da1ed1b52add1951c90
Diffstat (limited to 'heatclient/exc.py')
-rw-r--r--heatclient/exc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/heatclient/exc.py b/heatclient/exc.py
index ea7d575..7d4968c 100644
--- a/heatclient/exc.py
+++ b/heatclient/exc.py
@@ -13,6 +13,7 @@
import sys
from oslo_serialization import jsonutils
+from oslo_utils import reflection
from heatclient.openstack.common._i18n import _
@@ -78,9 +79,9 @@ class HTTPMultipleChoices(HTTPException):
"available.")
return (_("%(name)s (HTTP %(code)s) %(details)s") %
{
- 'name': self.__class__.__name__,
- 'code': self.code,
- 'details': self.details})
+ 'name': reflection.get_class_name(self, fully_qualified=False),
+ 'code': self.code,
+ 'details': self.details})
class BadRequest(HTTPException):