Use instanceof instead of type

Adjusted conditional statements to use instanceof when
comparing variables. Instanceof supports inheritance type
checking better than type.

Change-Id: I449f3df92b3646c384de717b7d53f7f85258c449
This commit is contained in:
Brandon Palm 2016-02-24 13:46:39 -06:00
parent 8155d453c8
commit 6b5e3d1faa
2 changed files with 2 additions and 2 deletions
cinderclient

@ -42,7 +42,7 @@ class FakeClient(object):
result = True
try:
for key, value in partial.items():
if type(value) is dict:
if isinstance(value, dict):
result = self._dict_match(value, real[key])
else:
assert real[key] == value

@ -140,7 +140,7 @@ def print_list(objs, fields, exclude_unavailable=False, formatters=None,
field_name = field.replace(' ', '_')
else:
field_name = field.lower().replace(' ', '_')
if type(o) == dict and field in o:
if isinstance(o, dict) and field in o:
data = o[field]
else:
if not hasattr(o, field_name) and exclude_unavailable: