driver.py should log errors when ssh operations fail
Improve error_handling for do_ssh function, by adding log when error
Closes-Bug: #1230010
Change-Id: I6e5c7f8de36ace9f9a1b5686c92a3dfa53a450f2
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index e518d28..a400d3b 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -34,11 +34,14 @@
username = admin_manager.config.stress.target_ssh_user
key_filename = admin_manager.config.stress.target_private_key_path
if not (username and key_filename):
+ LOG.error('username and key_filename should not be empty')
return None
ssh_client = ssh.Client(host, username, key_filename=key_filename)
try:
return ssh_client.exec_command(command)
except exceptions.SSHExecCommandFailed:
+ LOG.error('do_ssh raise exception. command:%s, host:%s.'
+ % (command, host))
return None