diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-08 11:32:01 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-25 08:30:20 -0700 |
commit | 3f533ff0264530d16de0db863c79da57e4de0060 (patch) | |
tree | ec2c551467fdea7bc8c71e44837b992b10662a09 /yardstick/benchmark/contexts/heat.py | |
parent | f266b33ff501b6ef04ab4cd0dcdc6858581dbaf3 (diff) |
Heat: use pkey from string instead of key_filename
Instead of using a key_filename for Heat, we can
read the key as a string directly using pkg_resources.resource_string()
This will enable us to save Heat stacks as pod.yaml, because
we can embedded the key into the pod.yaml directly.
Change-Id: I16baaba17dab845ee0846f97678733bae33cb463
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts/heat.py')
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index 2f3cc5a30..9a7b3817f 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -413,10 +413,6 @@ class HeatContext(Context): attr_name: either a name for a server created by yardstick or a dict with attribute name mapping when using external heat templates """ - key_filename = pkg_resources.resource_filename( - 'yardstick.resources', - h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid))) - if isinstance(attr_name, collections.Mapping): node_name, cname = self.split_name(attr_name['name']) if cname is None or cname != self.name: @@ -434,9 +430,13 @@ class HeatContext(Context): if server is None: return None + pkey = pkg_resources.resource_string( + 'yardstick.resources', + h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid))).decode('utf-8') + result = { "user": server.context.user, - "key_filename": key_filename, + "pkey": pkey, "private_ip": server.private_ip, "interfaces": server.interfaces, "routing_table": self.generate_routing_table(server), |