]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix to ignore ssh-key checking if running on virtual machines or
authorWarren Usui <warren.usui@inktank.com>
Tue, 18 Jun 2013 21:23:22 +0000 (14:23 -0700)
committerSage Weil <sage@inktank.com>
Wed, 19 Jun 2013 18:12:09 +0000 (11:12 -0700)
if a line that reads 'sshkey: ignore' is in the yaml file.

Fix #5364
Signed-off-by: Warren Usui <warren.usui@inktank.com>
teuthology/misc.py
teuthology/orchestra/connection.py
teuthology/task/internal.py

index f5e7793e40aecfc407b7af1dc2217eeb657638b3..d7fb2e5d94302fc2fadf1472c1e55355693b9936 100644 (file)
@@ -727,10 +727,6 @@ def reconnect(ctx, timeout, remotes=None):
             try:
                 log.info('trying to connect to %s', remote.name)
                 key = ctx.config['targets'][remote.name]
-                if is_vm(remote.name):
-                    kstat = lockstatus.get_status(ctx,remote.name)
-                    if 'sshpubkey' in kstat:
-                        key = kstat['sshpubkey']
                 from .orchestra import connection
                 remote.ssh = connection.connect(
                     user_at_host=remote.name,
index c769411db67516fdb3ba25bf1bf7af85c53cce12..2473c19b1480ec53d21e99d136905aa296c31f10 100644 (file)
@@ -24,6 +24,8 @@ def connect(user_at_host, host_key=None, keep_alive=False,
     if _SSHClient is None:
         _SSHClient = paramiko.SSHClient
     ssh = _SSHClient()
+    if host_key is None:
+       ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
     if _create_key is None:
         _create_key = create_key
 
index ebe9edcbefd2c93a7ff5b9523aa1c7056b904031..dae1217d35937644569083f81943fa0d506ae36b 100644 (file)
@@ -176,15 +176,17 @@ def connect(ctx, config):
     machs = []
     for name in ctx.config['targets'].iterkeys():
         machs.append(name)
-    lock.scan_for_locks(ctx, machs) 
-    for t, xkey in ctx.config['targets'].iteritems():
+    for t, key in ctx.config['targets'].iteritems():
         log.debug('connecting to %s', t)
-        log.info('Key is :%s:', xkey) 
-        oldkeystatus = lockstatus.get_status(ctx, t)
-        key = xkey
-        if 'sshpubkey' in oldkeystatus:
-            log.info('possible key is :%s:',oldkeystatus['sshpubkey'])
-            key = oldkeystatus['sshpubkey']
+        try:
+            if ctx.config['sshkeys'] == 'ignore':
+                key = None
+        except (AttributeError, KeyError):
+            pass
+        for machine in ctx.config['targets'].iterkeys():
+            if teuthology.is_vm(machine):
+                key = None
+                break
         remotes.append(
             remote.Remote(name=t,
                           ssh=connection.connect(user_at_host=t,