Revert "Fixes a bug with issubclass() being called on an instance"

This reverts commit e3d772050f.

"formatters" argument in get_dict_properties() and get_item_properties()
expects a class of FormattableColumn instead of its instance.

commit e3d772050f replaced issubclass()
with isinstance() unexpectedly. As a result, osc-lib 1.11.0 breaks
existing OSC plugin (at least neutronclient OSC plugin).

Story: 2003133
Task: 23255

Change-Id: Ie10063197f02679e987e87cb4852f5230a02f76d
This commit is contained in:
Akihiro Motoki 2018-07-28 01:47:42 +09:00 committed by Yushiro FURUKAWA
parent 049a006f15
commit 46e2fb0a58

View File

@ -430,7 +430,7 @@ def get_dict_properties(item, fields, mixed_case_fields=None, formatters=None):
data = item[field_name] if field_name in item else ''
if field in formatters:
formatter = formatters[field]
if isinstance(formatter, cliff_columns.FormattableColumn):
if issubclass(formatter, cliff_columns.FormattableColumn):
data = formatter(data)
else:
warnings.warn(