diff options
author | Emma Foley <emma.l.foley@intel.com> | 2018-03-06 17:21:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-06 17:21:43 +0000 |
commit | 983435d34a8d3bd73417ba96bc75c3e3ddca6b0a (patch) | |
tree | 6b1a4a996a0dd9a36fff63318a7b995e3ac5086a /yardstick/benchmark | |
parent | 8544a361f831f324eae33f8a48b94bf2a34f5ab0 (diff) | |
parent | 0272210284bca74a386cf4ce19c4a4562e941aaf (diff) |
Merge "Move SSH key generation from "init" to "deploy""
Diffstat (limited to 'yardstick/benchmark')
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index 3b4f0fcd9..0d1dfb86f 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -134,16 +134,6 @@ class HeatContext(Context): self.attrs = attrs - self.key_filename = ''.join( - [consts.YARDSTICK_ROOT_PATH, - 'yardstick/resources/files/yardstick_key-', - self.name]) - # Permissions may have changed since creation; this can be fixed. If we - # overwrite the file, we lose future access to VMs using this key. - # As long as the file exists, even if it is unreadable, keep it intact - if not os.path.exists(self.key_filename): - SSH.gen_keys(self.key_filename) - def check_environment(self): try: os.environ['OS_AUTH_URL'] @@ -311,7 +301,7 @@ class HeatContext(Context): timeout=self.heat_timeout) except KeyboardInterrupt: raise y_exc.StackCreationInterrupt - except: + except Exception: LOG.exception("stack failed") # let the other failures happen, we want stack trace raise @@ -328,6 +318,16 @@ class HeatContext(Context): """deploys template into a stack using cloud""" LOG.info("Deploying context '%s' START", self.name) + self.key_filename = ''.join( + [consts.YARDSTICK_ROOT_PATH, + 'yardstick/resources/files/yardstick_key-', + self.name]) + # Permissions may have changed since creation; this can be fixed. If we + # overwrite the file, we lose future access to VMs using this key. + # As long as the file exists, even if it is unreadable, keep it intact + if not os.path.exists(self.key_filename): + SSH.gen_keys(self.key_filename) + heat_template = HeatTemplate(self.name, self.template_file, self.heat_parameters) |