]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/connection: support alternate ssh config path 1921/head
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 17 Feb 2024 15:49:31 +0000 (10:49 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 17 Feb 2024 15:49:31 +0000 (10:49 -0500)
Allow the configuration to specify a `ssh_config_path` parameter.
In my "lab" setup I populate a custom ssh-config rather than constantly
adding and removing entries from my "real" ssh config file.

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

index 785a8c5edefbe593c6cba8dca43c4e0a377fcecd..4e6b042bfb4f4b79718115a92625fd88ec367941 100644 (file)
@@ -80,7 +80,8 @@ def connect(user_at_host, host_key=None, keep_alive=False, timeout=60,
     )
 
     key_filename = key_filename or config.ssh_key
-    ssh_config_path = os.path.expanduser("~/.ssh/config")
+    ssh_config_path = config.ssh_config_path or "~/.ssh/config"
+    ssh_config_path = os.path.expanduser(ssh_config_path)
     if not key_filename and os.path.exists(ssh_config_path):
         ssh_config = paramiko.SSHConfig()
         ssh_config.parse(open(ssh_config_path))