The host_file got by os.tmpfile() is not available for "ssh -o UserKnownHostsFile " on ubuntu 11.10 and will have the error "Failed to add the host to the list of known hosts (/dev/fd/11)", so the patch just replace it with '/dev/null'.

Signed-off-by: Wenyi Gao <[email protected]>
---
 server/hosts/abstract_ssh.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/server/hosts/abstract_ssh.py b/server/hosts/abstract_ssh.py
index 582fa40..1a0b3e9 100644
--- a/server/hosts/abstract_ssh.py
+++ b/server/hosts/abstract_ssh.py
@@ -50,9 +50,7 @@ class AbstractSSHHost(SiteHost):
         self.port = port
         self.password = password
         self._use_rsync = None
-        self.known_hosts_file = os.tmpfile()
-        known_hosts_fd = self.known_hosts_file.fileno()
-        self.known_hosts_fd = '/dev/fd/%s' % known_hosts_fd
+        self.known_hosts_fd = '/dev/null'

         """
Master SSH connection background job, socket temp directory and socket
@@ -567,7 +565,6 @@ class AbstractSSHHost(SiteHost):
     def close(self):
         super(AbstractSSHHost, self).close()
         self._cleanup_master_ssh()
-        self.known_hosts_file.close()


     def _cleanup_master_ssh(self):
--
1.7.5.4
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to