Switch type(certificate) and type(obj)
Switch type(certificate) and type(obj) to instance since its accords with python style. Story: 2006796 Task: 42442 Test: - Ran unit tests. - Built iso and ran some smoke tests. - Tested on general install on controller+storage+workers system, bootstrapped ok. Signed-off-by: Charles Short <charles.short@windriver.com> Change-Id: I03d444f3ae67ab802881b8ede90f1e1c7e9694cc
This commit is contained in:
parent
7a2a54c2b7
commit
62c9e55efd
|
@ -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