From 2e6b9b091c9bf888a05eb0a1ddff5e6f273400df Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Wed, 15 Mar 2017 19:47:24 -0700 Subject: model: pylint fixes remove redundnant parens replace type with isinstance fix import order Change-Id: I0407cbbf6993290f392f17c398827603b5bc1ebd Signed-off-by: Ross Brattain --- tests/unit/benchmark/contexts/test_model.py | 2 +- yardstick/benchmark/contexts/model.py | 4 ++-- 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" % -- cgit 1.2.3-korg