From 7cb59d3b8274e61cb610501c24ca1520d09c2d93 Mon Sep 17 00:00:00 2001 From: tamil Date: Thu, 16 May 2013 09:49:40 -0700 Subject: [PATCH] added UserKnownHostsfile to ssh config Signed-off-by: tamil --- teuthology/task/ssh_keys.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/teuthology/task/ssh_keys.py b/teuthology/task/ssh_keys.py index 94b43f823fbed..dd04ac1ebcb6e 100644 --- a/teuthology/task/ssh_keys.py +++ b/teuthology/task/ssh_keys.py @@ -8,7 +8,6 @@ from cStringIO import StringIO from teuthology import contextutil import teuthology.misc as misc from ..orchestra import run -from ..orchestra.connection import create_key log = logging.getLogger(__name__) ssh_keys_user = 'ssh-keys-user' @@ -71,9 +70,15 @@ def tweak_ssh_config(ctx, config): run.wait( ctx.cluster.run( args=[ - 'echo', - 'StrictHostKeyChecking no\n', - run.Raw('>'), + 'echo', + 'StrictHostKeyChecking no\n', + run.Raw('>'), + run.Raw('/home/ubuntu/.ssh/config'), + run.Raw('&&'), + 'echo', + 'UserKnownHostsFile ', + run.Raw('/dev/null'), + run.Raw('>>'), run.Raw('/home/ubuntu/.ssh/config'), ], wait=False, @@ -164,9 +169,9 @@ def task(ctx, config): pre_run_cleanup_keys(ctx) with contextutil.nested( + lambda: tweak_ssh_config(ctx, config), lambda: push_keys_to_host(ctx, config, public_key_string, private_key_string), - lambda: tweak_ssh_config(ctx, config), - + #lambda: tweak_ssh_config(ctx, config), ): yield -- 2.39.5