]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/connection: support ssh config HostName option
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 17 Feb 2024 15:46:44 +0000 (10:46 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 17 Feb 2024 15:46:44 +0000 (10:46 -0500)
Allow teuthology's ssh support to use ssh-config sections like:
```
Host foobar.lab.example.com
    HostName 192.168.76.206
```

This permits me to better use teuthology in my "lab" setup where I don't
have real dns entries for the test nodes.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
teuthology/orchestra/connection.py

index 8190fa50757c71b1eb2eb5844de8509eec86315a..785a8c5edefbe593c6cba8dca43c4e0a377fcecd 100644 (file)
@@ -87,6 +87,8 @@ def connect(user_at_host, host_key=None, keep_alive=False, timeout=60,
         opts = ssh_config.lookup(host)
         if not key_filename and 'identityfile' in opts:
             key_filename = opts['identityfile']
+        if 'hostname' in opts:
+            connect_args['hostname'] = opts['hostname']
 
     if key_filename:
         if not isinstance(key_filename, list):