summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiuNanke <nanke.liu@easystack.cn>2016-01-08 15:39:16 +0800
committerLiuNanke <nanke.liu@easystack.cn>2016-01-08 15:39:16 +0800
commit53c56e3fd4a600daea151d8bd7d6b3295b7d3f29 (patch)
tree8d987c6243a83adec25e50ddf90fbb8df17a3e7c
parent6097b0ce2ed80651f2e49c47adf7c0b5a11f5431 (diff)
downloadpython-ceilometerclient-53c56e3fd4a600daea151d8bd7d6b3295b7d3f29.tar.gz
Use the oslo.utils.reflection to extract the class name
The oslo.utils reflection module/code handles more variations of where a class name may come from (on python 2 and python 3) so its usage allows getting more accurate class names so we might as well use it. Change-Id: Ic6a1d4a34336ae6501c48e92e8114932c283650f
-rw-r--r--ceilometerclient/openstack/common/apiclient/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ceilometerclient/openstack/common/apiclient/base.py b/ceilometerclient/openstack/common/apiclient/base.py
index 8493b44..17016eb 100644
--- a/ceilometerclient/openstack/common/apiclient/base.py
+++ b/ceilometerclient/openstack/common/apiclient/base.py
@@ -43,6 +43,7 @@ import copy
from oslo_utils import strutils
import six
from six.moves.urllib import parse
+from oslo_utils import reflection
from ceilometerclient.openstack.common._i18n import _
from ceilometerclient.openstack.common.apiclient import exceptions
@@ -463,7 +464,9 @@ class Resource(object):
for k in self.__dict__.keys()
if k[0] != '_' and k != 'manager')
info = ", ".join("%s=%s" % (k, getattr(self, k)) for k in reprkeys)
- return "<%s %s>" % (self.__class__.__name__, info)
+ self_cls_name = reflection.get_class_name(self,
+ fully_qualified=False)
+ return "<%s %s>" % (self_cls_name, info)
@property
def human_id(self):