aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-12 09:41:45 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-15 15:32:11 -0700
commitbe06e38960cea8a54c85418948e8453861012d2d (patch)
tree03847348fc74492f4e298d023bbbbb8b76388185 /yardstick/benchmark/contexts
parent3016786696b9e5a26b364cb5bd4cb5676420fe58 (diff)
Generate pod.yaml from current context
We want to generate pod.yaml from Heat contexts so we can re-use the context without destroying it. But we don't have node role information and it doesn't make sense in this case, so make the role optional. Since we changed Heat to use pkey instead of key_filename, we can embed the pkey into the pod.yaml, but we have to make sure to convert the pkey to string, in case it is a RSAKey object Change-Id: Ibefcfbd8236e68013a704c39964cb870da825da8 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts')
-rw-r--r--yardstick/benchmark/contexts/heat.py2
-rw-r--r--yardstick/benchmark/contexts/node.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index c7586abf4..2f3cc5a30 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -442,6 +442,8 @@ class HeatContext(Context):
"routing_table": self.generate_routing_table(server),
# empty IPv6 routing table
"nd_route_tbl": [],
+ # we want to save the contex name so we can generate pod.yaml
+ "name": server.name,
}
# Target server may only have private_ip
if server.public_ip:
diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py
index 250032efc..ffc82c8ed 100644
--- a/yardstick/benchmark/contexts/node.py
+++ b/yardstick/benchmark/contexts/node.py
@@ -74,11 +74,11 @@ class NodeContext(Context):
self.nodes.extend(cfg["nodes"])
self.controllers.extend([node for node in cfg["nodes"]
- if node["role"] == "Controller"])
+ if node.get("role") == "Controller"])
self.computes.extend([node for node in cfg["nodes"]
- if node["role"] == "Compute"])
+ if node.get("role") == "Compute"])
self.baremetals.extend([node for node in cfg["nodes"]
- if node["role"] == "Baremetal"])
+ if node.get("role") == "Baremetal"])
LOG.debug("Nodes: %r", self.nodes)
LOG.debug("Controllers: %r", self.controllers)
LOG.debug("Computes: %r", self.computes)