This polls when a timeout is specified because ssh doesn't timeout
quickly. This means that wait_down returns much more quickly if the
host isn't up and a timeout is specified. This is needed to ensure
autotest server's state tracks the host state correctly.
Signed-off-by: Ryan Stutsman <stutsman@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@602 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index f2eb297..8619bc4 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -271,10 +271,7 @@
while not timeout or time.time() < end_time:
try:
- if timeout:
- run_timeout= end_time - time.time()
- else:
- run_timeout= 10
+ run_timeout= 10
result= self.run("true", timeout=run_timeout)
except errors.AutoservRunError:
return True