aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKubi <jean.gaoliang@huawei.com>2017-02-14 09:23:17 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-14 09:23:17 +0000
commit61c9612197d9a204cc7efa0a324a2b136886506f (patch)
tree26c22cee696388cc28c47a4203e9b50c834f301e
parent5ecd7b446156775b8adb9cd15fe7decea5d305d9 (diff)
parentb82105f8bf793e78f8c144c1d833989cb14d944b (diff)
Merge "heat: minor fixes, don't use len > 0 and use next instead of [0]"
-rw-r--r--yardstick/benchmark/contexts/heat.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 0b9a4d294..4c7f05236 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -221,9 +221,9 @@ class HeatContext(Context):
# copy some vital stack output into server objects
for server in self.servers:
- if len(server.ports) > 0:
+ if server.ports:
# TODO(hafe) can only handle one internal network for now
- port = list(server.ports.values())[0]
+ port = next(iter(server.ports.values()))
server.private_ip = self.stack.outputs[port["stack_name"]]
if server.floating_ip: