aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--yardstick/benchmark/contexts/heat.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 0b2fbdcd6..79b7472ff 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -94,9 +94,10 @@ class HeatContext(Context):
rsa_key = paramiko.RSAKey.generate(bits=2048, progress_func=None)
rsa_key.write_private_key_file(self.key_filename)
- open(self.key_filename + ".pub", "w").write("%s %s\n" %
- (rsa_key.get_name(),
- rsa_key.get_base64()))
+ print("Writing %s ..." % self.key_filename)
+ with open(self.key_filename + ".pub", "w") as pubkey_file:
+ pubkey_file.write(
+ "%s %s\n" % (rsa_key.get_name(), rsa_key.get_base64()))
del rsa_key
@property