Merge "Switch type(certificate) and type(obj)"

This commit is contained in:
Zuul 2021-05-10 13:23:13 +00:00 committed by Gerrit Code Review
commit 642cc0c8ee
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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]