Are you sure this is not going to print lots of messages like this in the
log file?

[stderr] Warning: Permanently added '192.168.122.99' (RSA) to the list
of known hosts.

A long time ago I suggested the /dev/fd solution to replace /dev/null to
cut down the number of those messages which gets printed *everytime* ssh is
run.  Those messages could number in the hundreds for long running tests.

-Jongki

On Wed, Nov 2, 2011 at 2:12 AM, Wenyi Gao <[email protected]> wrote:

> **
> 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]> <[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
>
>
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to