summaryrefslogtreecommitdiff
path: root/oslo_utils/reflection.py
diff options
context:
space:
mode:
authorJoshua Harlow <jxharlow@godaddy.com>2016-12-09 15:16:33 -0800
committerJoshua Harlow <jxharlow@godaddy.com>2016-12-09 15:16:35 -0800
commit749ae853474e3310b0d95d4cd4470b7c43c53b25 (patch)
treea1a2fb3e24ba8526cb6f20b0583292ca493ce0e6 /oslo_utils/reflection.py
parent4eeee2a641538d55d0ab006c61f85d234832efae (diff)
downloadoslo-utils-749ae853474e3310b0d95d4cd4470b7c43c53b25.tar.gz
Allow 'get_all_class_names' to pass kwargs
The keyword arguments fully_qualified and truncate_builtins are useful to allow to be passed, and are meaningful to pass along from this function to the `get_class_name` function so let them be passed. Change-Id: I0787bbaf209f3c223e72214d63e006cfc1d40866
Diffstat (limited to 'oslo_utils/reflection.py')
-rw-r--r--oslo_utils/reflection.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/oslo_utils/reflection.py b/oslo_utils/reflection.py
index ef2563a..acd82ca 100644
--- a/oslo_utils/reflection.py
+++ b/oslo_utils/reflection.py
@@ -96,7 +96,8 @@ def get_class_name(obj, fully_qualified=True, truncate_builtins=True):
return obj.__name__
-def get_all_class_names(obj, up_to=object):
+def get_all_class_names(obj, up_to=object,
+ fully_qualified=True, truncate_builtins=True):
"""Get class names of object parent classes.
Iterate over all class names object is instance or subclass of,
@@ -107,7 +108,9 @@ def get_all_class_names(obj, up_to=object):
obj = type(obj)
for cls in obj.mro():
if issubclass(cls, up_to):
- yield get_class_name(cls)
+ yield get_class_name(cls,
+ fully_qualified=fully_qualified,
+ truncate_builtins=truncate_builtins)
def get_callable_name(function):