aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/benchmark/contexts/test_model.py2
-rw-r--r--yardstick/benchmark/contexts/model.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/benchmark/contexts/test_model.py b/tests/unit/benchmark/contexts/test_model.py
index a4b7d81ef..6ae4e6dac 100644
--- a/tests/unit/benchmark/contexts/test_model.py
+++ b/tests/unit/benchmark/contexts/test_model.py
@@ -12,8 +12,8 @@
# Unittest for yardstick.benchmark.contexts.model
from __future__ import absolute_import
-import mock
import unittest
+import mock
from yardstick.benchmark.contexts import model
diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py
index 8cf3b621c..4873afde3 100644
--- a/yardstick/benchmark/contexts/model.py
+++ b/yardstick/benchmark/contexts/model.py
@@ -154,7 +154,7 @@ class Server(Object): # pragma: no cover
self.placement_groups = []
placement = attrs.get("placement", [])
- placement = placement if type(placement) is list else [placement]
+ placement = placement if isinstance(placement, list) else [placement]
for p in placement:
pg = PlacementGroup.get(p)
if not pg:
@@ -166,7 +166,7 @@ class Server(Object): # pragma: no cover
# support servergroup attr
self.server_group = None
sg = attrs.get("server_group")
- if (sg):
+ if sg:
server_group = ServerGroup.get(sg)
if not server_group:
raise ValueError("server '%s', server_group '%s' is invalid" %