Fix execute_script method to avoid infinite wait.
Fix execute_script method
Add support for timeout to execute_script
Change-Id: I8375ae174bc4631f5f56ce575be343d0f58d0318
diff --git a/neutron_tempest_plugin/exceptions.py b/neutron_tempest_plugin/exceptions.py
index c9264ca..ff5b2cf 100644
--- a/neutron_tempest_plugin/exceptions.py
+++ b/neutron_tempest_plugin/exceptions.py
@@ -28,3 +28,23 @@
class InvalidServiceTag(TempestException):
message = "Invalid service tag"
+
+
+class SSHScriptException(exceptions.TempestException):
+ """Base class for SSH client execute_script() exceptions"""
+
+
+class SSHScriptTimeoutExpired(SSHScriptException):
+ message = ("Timeout expired while executing script on host %(host)r:\n"
+ "script:\n%(script)s\n"
+ "stderr:\n%(stderr)s\n"
+ "stdout:\n%(stdout)s\n"
+ "timeout: %(timeout)s")
+
+
+class SSHScriptFailed(SSHScriptException):
+ message = ("Failed executing script on remote host %(host)r:\n"
+ "script:\n%(script)s\n"
+ "stderr:\n%(stderr)s\n"
+ "stdout:\n%(stdout)s\n"
+ "exit_status: %(exit_status)s")