aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-02-23 01:38:11 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-23 01:38:11 +0000
commitdc8a65358cea4df851f34f92e25d3313194d13bb (patch)
tree288ce86fff6f0fbdd817879d930674b55b585a7a
parentc0ad3eb3d5cdcb6b1cdc529f6cfcfc1922f86f8d (diff)
parent6f51d2562e010d3d4dba2c4473ac2e6e654558e0 (diff)
Merge "improving if conditions :)"
-rw-r--r--yardstick/benchmark/contexts/heat.py4
-rwxr-xr-xyardstick/benchmark/runners/base.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 4c7f05236..4ca44b0ed 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -158,7 +158,7 @@ class HeatContext(Context):
# workround for openstack nova bug, check JIRA: YARDSTICK-200
# for details
if len(availability_servers) == 2:
- if len(scheduler_hints["different_host"]) == 0:
+ if not scheduler_hints["different_host"]:
scheduler_hints.pop("different_host", None)
server.add_to_template(template,
self.networks,
@@ -197,7 +197,7 @@ class HeatContext(Context):
# add remaining servers with no placement group configured
for server in list_of_servers:
- if len(server.placement_groups) == 0:
+ if not server.placement_groups:
server.add_to_template(template, self.networks, {})
def deploy(self):
diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py
index bf1a71cab..5b9081523 100755
--- a/yardstick/benchmark/runners/base.py
+++ b/yardstick/benchmark/runners/base.py
@@ -127,7 +127,7 @@ class Runner(object):
"""Returns instance of a scenario runner for execution type.
"""
# if there is no runner, start the output serializer subprocess
- if len(Runner.runners) == 0:
+ if not Runner.runners:
log.debug("Starting dump process file '%s'",
config["output_filename"])
Runner.queue = multiprocessing.Queue()
@@ -155,7 +155,7 @@ class Runner(object):
Runner.runners.remove(runner)
# if this was the last runner, stop the output serializer subprocess
- if len(Runner.runners) == 0:
+ if not Runner.runners:
Runner.release_dump_process()
@staticmethod
@@ -170,7 +170,7 @@ class Runner(object):
log.debug("Terminating all runners")
# release dumper process as some errors before any runner is created
- if len(Runner.runners) == 0:
+ if not Runner.runners:
Runner.release_dump_process()
return