Fixed SSHHost.hardreset to raise an exception if the operation is unsupported
on the remote host.
From: John Admanski <jadmanski@google.com>
Signed-off-by: Martin J. Bligh <mbligh@google.com>
-This line, and those below, will be ignored--
M server/autotest.py
M server/hosts/ssh_host.py
M server/errors.py
git-svn-id: http://test.kernel.org/svn/autotest/trunk@843 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index 1a79a62..fe6e1e1 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -186,10 +186,11 @@
"""
Reach out and slap the box in the power switch
"""
- result = self.__console_run(r"'~$hardreset'")
- if wait:
- self.__wait_for_restart(timeout)
- return result
+ command_ran = self.__console_run(r"'~$hardreset'")
+ if not command_ran:
+ raise errors.AutoservUnsupportedError
+ if wait:
+ self.__wait_for_restart(timeout)
def __start_console_log(self, logfilename):