aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-01-08 01:02:44 -0800
committerRoss Brattain <ross.b.brattain@intel.com>2017-01-17 23:29:14 -0800
commitb82105f8bf793e78f8c144c1d833989cb14d944b (patch)
tree9857da6daed635eec5524e7db040f793e8ca1d29
parent4b706011d16f3dfd4fe0a78c5d8706d69deecdeb (diff)
heat: minor fixes, don't use len > 0 and use next
instead of [0] Change-Id: I1785b7ca3543a8d44eb68de61f4f29063a9c61c7 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-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 0b2fbdcd6..a9d9e5fc0 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -220,9 +220,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: