Use isinstance instead of type
Adjusted conditional statements to use isinstance when
comparing variables. Isinstance supports inheritance type
checking better than type.
Change-Id: Id194b9edf4cda615de9007bc187b647d4718a567
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index e474d86..95be89e 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -756,7 +756,7 @@
# we cannot assume they all have the same signature so we need to discard
# the unused response first value it two values are being returned.
body = get_resources()
- if type(body) == tuple:
+ if isinstance(body, tuple):
body = body[1]
if isinstance(body, dict):
body = body[resource]
diff --git a/tempest/lib/cmd/check_uuid.py b/tempest/lib/cmd/check_uuid.py
index 3adeecd..be3aa49 100755
--- a/tempest/lib/cmd/check_uuid.py
+++ b/tempest/lib/cmd/check_uuid.py
@@ -173,9 +173,9 @@
@staticmethod
def _import_name(node):
- if type(node) == ast.Import:
+ if isinstance(node, ast.Import):
return node.names[0].name
- elif type(node) == ast.ImportFrom:
+ elif isinstance(node, ast.ImportFrom):
return '%s.%s' % (node.module, node.names[0].name)
def _add_import_for_test_uuid(self, patcher, src_parsed, source_path):