Merge "Switch type(certificate) and type(obj)"
This commit is contained in:
commit
642cc0c8ee
|
@ -15,7 +15,7 @@ from cgtsclient import exc
|
|||
|
||||
def _print_certificate_show(certificate):
|
||||
fields = ['uuid', 'certtype', 'signature', 'start_date', 'expiry_date']
|
||||
if type(certificate) is dict:
|
||||
if isinstance(certificate, dict):
|
||||
data = [(f, certificate.get(f, '')) for f in fields]
|
||||
details = ('details', certificate.get('details', ''))
|
||||
else:
|
||||
|
|
|
@ -15,7 +15,7 @@ def _print_device_image_show(obj):
|
|||
'name', 'description', 'image_version',
|
||||
'applied', 'applied_labels']
|
||||
|
||||
if type(obj) is dict:
|
||||
if isinstance(obj, dict):
|
||||
data = [(f, obj.get(f, '')) for f in fields]
|
||||
else:
|
||||
data = [(f, getattr(obj, f, '')) for f in fields]
|
||||
|
|
Loading…
Reference in New Issue