diff options
author | LiuNanke <nanke.liu@easystack.cn> | 2016-01-08 15:48:00 +0800 |
---|---|---|
committer | LiuNanke <nanke.liu@easystack.cn> | 2016-01-08 17:21:14 +0800 |
commit | 416457de4db4d06468fd783b3a604521e0853ee8 (patch) | |
tree | 3f694f2df3028c82817da67c879f463e3abb9c99 /troveclient/compat | |
parent | fa7d8f4b9f64593e9263fd19486afabfacfb422b (diff) | |
download | python-troveclient-416457de4db4d06468fd783b3a604521e0853ee8.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: I7b130d6acb183a06a4efe648ee2c3fbd2905cdd5
Diffstat (limited to 'troveclient/compat')
-rw-r--r-- | troveclient/compat/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/troveclient/compat/base.py b/troveclient/compat/base.py index e47c6da..3e894ae 100644 --- a/troveclient/compat/base.py +++ b/troveclient/compat/base.py @@ -22,6 +22,7 @@ Base utilities to build API operation managers and objects on top of. import contextlib import hashlib import os +from oslo_utils import reflection from troveclient.compat import exceptions from troveclient.compat import utils @@ -264,7 +265,9 @@ class Resource(object): reprkeys = sorted(k 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) def get(self): # set_loaded() first ... so if we have to bail, we know we tried. |