From: John Mulligan Date: Sat, 17 Feb 2024 15:49:31 +0000 (-0500) Subject: orchestra/connection: support alternate ssh config path X-Git-Tag: 1.2.0~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1921%2Fhead;p=teuthology.git orchestra/connection: support alternate ssh config path 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 --- diff --git a/teuthology/orchestra/connection.py b/teuthology/orchestra/connection.py index 785a8c5ed..4e6b042bf 100644 --- a/teuthology/orchestra/connection.py +++ b/teuthology/orchestra/connection.py @@ -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))