예제 #1
0
 def _delete_key_file(self):
     try:
         utils.remove_file(self.key_filename)
         utils.remove_file(self.key_filename + ".pub")
     except OSError:
         LOG.exception("There was an error removing the key file %s",
                       self.key_filename)
예제 #2
0
 def _delete_key_file(self):
     # Only remove the key file if it has been generated by yardstick
     if self.yardstick_gen_key_file:
         try:
             utils.remove_file(self.key_filename)
             utils.remove_file(self.key_filename + ".pub")
         except OSError:
             LOG.exception("There was an error removing the key file %s",
                           self.key_filename)
예제 #3
0
 def _delete_ssh_key(self):
     k8s_utils.delete_config_map(self.ssh_key, skip_codes=[404])
     utils.remove_file(self.key_path)
     utils.remove_file(self.public_key_path)
예제 #4
0
 def test_remove_file(self):
     try:
         utils.remove_file('notexistfile.txt')
     except Exception as e:
         self.assertTrue(isinstance(e, OSError))
예제 #5
0
 def test_remove_file(self):
     try:
         utils.remove_file('notexistfile.txt')
     except Exception as e:  # pylint: disable=broad-except
         # NOTE(ralonsoh): to narrow the scope of this exception.
         self.assertTrue(isinstance(e, OSError))