summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-03-27 03:23:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-27 03:23:32 +0000
commit975860bd04dde49355c856449bcbf5cb290d7279 (patch)
tree9a6da72e2a5546fbf5e61ccaf2c915c0f07a27fe
parentc7114df918ca1d463e49a1c41805e8f414100e7c (diff)
parent2e6b9b091c9bf888a05eb0a1ddff5e6f273400df (diff)
Merge "model: pylint fixes"
-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" %